feat(thread): add thread functions

This commit is contained in:
fallenoak 2020-09-09 00:45:46 -05:00
parent d0487caba3
commit 266bdc7737
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
16 changed files with 523 additions and 0 deletions

17
storm/thread/SThread.cpp Normal file
View 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
}