2020-11-01 17:45:45 -06:00
|
|
|
#include "storm/thread/SThread.hpp"
|
|
|
|
|
#include "storm/Thread.hpp"
|
2020-09-09 00:45:46 -05:00
|
|
|
|
|
|
|
|
int32_t SThread::Create(uint32_t (*threadProc)(void*), void* param, SThread& thread, char* threadName, uint32_t a5) {
|
2020-12-02 20:04:02 -06:00
|
|
|
#if defined(WHOA_SYSTEM_WIN)
|
2022-12-28 20:03:31 -06:00
|
|
|
uint32_t v8;
|
|
|
|
|
auto handle = SCreateThread(threadProc, param, &v8, nullptr, nullptr);
|
|
|
|
|
thread.m_opaqueData = handle;
|
|
|
|
|
return handle != nullptr;
|
2020-09-09 00:45:46 -05:00
|
|
|
#endif
|
|
|
|
|
|
2020-12-02 20:04:02 -06:00
|
|
|
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
|
2021-08-09 00:13:52 -05:00
|
|
|
thread.int0 = 5;
|
|
|
|
|
thread.m_value1 = 0;
|
2020-09-09 00:45:46 -05:00
|
|
|
pthread_cond_init(&thread.m_cond, nullptr);
|
|
|
|
|
|
|
|
|
|
uint32_t v8;
|
2022-12-28 20:03:31 -06:00
|
|
|
auto handle = SCreateThread(threadProc, param, &v8, &thread, nullptr);
|
|
|
|
|
return handle != nullptr;
|
2020-09-09 00:45:46 -05:00
|
|
|
#endif
|
|
|
|
|
}
|