mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(thread): add thread functions
This commit is contained in:
parent
d0487caba3
commit
266bdc7737
16 changed files with 523 additions and 0 deletions
17
storm/thread/SThread.cpp
Normal file
17
storm/thread/SThread.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "thread/SThread.hpp"
|
||||
#include "Thread.hpp"
|
||||
|
||||
int32_t SThread::Create(uint32_t (*threadProc)(void*), void* param, SThread& thread, char* threadName, uint32_t a5) {
|
||||
#if defined(PLATFORM_WIN)
|
||||
// TODO implement
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
|
||||
thread.m_int0 = 5;
|
||||
thread.m_value = 0;
|
||||
pthread_cond_init(&thread.m_cond, nullptr);
|
||||
|
||||
uint32_t v8;
|
||||
return SCreateThread(threadProc, param, &v8, &thread, nullptr) != 0;
|
||||
#endif
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue