mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 18:42:28 +00:00
43 lines
1,007 B
Text
43 lines
1,007 B
Text
#include "storm/thread/S_Thread.hpp"
|
|
#include "storm/Memory.hpp"
|
|
|
|
uint32_t S_Thread::s_SLaunchThread(void* threadParam) {
|
|
// TODO
|
|
// SClearFP(1);
|
|
|
|
auto params = static_cast<SThreadParmBlock*>(threadParam);
|
|
|
|
// TODO
|
|
// S_Thread::s_threadCrit.Enter();
|
|
|
|
// TODO
|
|
// - something involving pthread_self()
|
|
|
|
// TODO
|
|
// S_Thread::s_threadCrit.Leave();
|
|
|
|
// TODO
|
|
// SErrAddFrameText("Calling thread proc %lx\n", params->threadProc);
|
|
params->threadProc(params->threadParam);
|
|
|
|
// TODO
|
|
// S_Thread::s_threadCrit.Enter();
|
|
|
|
// TODO
|
|
// - remove tracking in S_Thread::s_threads
|
|
// - decrement num threads
|
|
|
|
// TODO
|
|
// S_Thread::s_threadCrit.Leave();
|
|
|
|
if (params->syncObject) {
|
|
pthread_mutex_lock(¶ms->syncObject->m_mutex);
|
|
params->syncObject->m_value1 = 1;
|
|
pthread_mutex_unlock(¶ms->syncObject->m_mutex);
|
|
pthread_cond_signal(¶ms->syncObject->m_cond);
|
|
}
|
|
|
|
SMemFree(threadParam);
|
|
|
|
return 0;
|
|
}
|