mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(thread): implement SThread::Create for windows
This commit is contained in:
parent
4dbfb0b3be
commit
db87a5d782
7 changed files with 41 additions and 6 deletions
|
|
@ -3,8 +3,10 @@
|
|||
|
||||
int32_t SThread::Create(uint32_t (*threadProc)(void*), void* param, SThread& thread, char* threadName, uint32_t a5) {
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
// TODO implement
|
||||
return 0;
|
||||
uint32_t v8;
|
||||
auto handle = SCreateThread(threadProc, param, &v8, nullptr, nullptr);
|
||||
thread.m_opaqueData = handle;
|
||||
return handle != nullptr;
|
||||
#endif
|
||||
|
||||
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
|
||||
|
|
@ -13,6 +15,7 @@ int32_t SThread::Create(uint32_t (*threadProc)(void*), void* param, SThread& thr
|
|||
pthread_cond_init(&thread.m_cond, nullptr);
|
||||
|
||||
uint32_t v8;
|
||||
return SCreateThread(threadProc, param, &v8, &thread, nullptr) != 0;
|
||||
auto handle = SCreateThread(threadProc, param, &v8, &thread, nullptr);
|
||||
return handle != nullptr;
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue