diff --git a/storm/thread/SEvent.cpp b/storm/thread/SEvent.cpp index 6843ad2..57cb1bf 100644 --- a/storm/thread/SEvent.cpp +++ b/storm/thread/SEvent.cpp @@ -7,8 +7,8 @@ SEvent::SEvent(int32_t manualReset, int32_t initialValue) #endif #if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX) - this->m_int0 = 2 - (manualReset >= 1); - this->m_value = initialValue; + this->int0 = 2 - (manualReset >= 1); + this->m_value1 = initialValue; pthread_cond_init(&this->m_cond, nullptr); #endif @@ -21,7 +21,7 @@ int32_t SEvent::Reset() { #if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX) pthread_mutex_lock(&this->m_mutex); - this->m_value = 0; + this->m_value1 = 0; pthread_mutex_unlock(&this->m_mutex); return 1; @@ -36,7 +36,7 @@ int32_t SEvent::Set() { #if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX) pthread_mutex_lock(&this->m_mutex); - this->m_value = 1; + this->m_value1 = 1; pthread_cond_signal(&this->m_cond); pthread_mutex_unlock(&this->m_mutex); diff --git a/storm/thread/SSyncObject.cpp b/storm/thread/SSyncObject.cpp index 779d384..3e6738e 100644 --- a/storm/thread/SSyncObject.cpp +++ b/storm/thread/SSyncObject.cpp @@ -18,7 +18,7 @@ uint32_t SSyncObject::Wait(uint32_t timeoutMs) { #endif #if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX) - if (this->m_int0 == 6) { + if (this->int0 == 6) { // WAIT_FAILED return 0xFFFFFFFF; } @@ -70,7 +70,7 @@ uint32_t SSyncObject::Wait(uint32_t timeoutMs) { usleep(0); } - if (this->m_int0 == 3) { + if (this->int0 == 3) { // WAIT_OBJECT_0 return 0; } @@ -78,7 +78,7 @@ uint32_t SSyncObject::Wait(uint32_t timeoutMs) { int32_t v4; while (true) { - v4 = this->m_value; + v4 = this->m_value1; if (v4) { break; @@ -99,10 +99,10 @@ uint32_t SSyncObject::Wait(uint32_t timeoutMs) { } } - if (this->m_int0 == 2) { - this->m_value = 0; - } else if (this->m_int0 == 4) { - this->m_value = v4 - 1; + if (this->int0 == 2) { + this->m_value1 = 0; + } else if (this->int0 == 4) { + this->m_value1 = v4 - 1; } pthread_mutex_unlock(&this->m_mutex); @@ -113,19 +113,19 @@ uint32_t SSyncObject::Wait(uint32_t timeoutMs) { pthread_mutex_lock(&this->m_mutex); - if (this->m_int0 == 3) { + if (this->int0 == 3) { // WAIT_OBJECT_0 return 0; } - while (!this->m_value) { + while (!this->m_value1) { pthread_cond_wait(&this->m_cond, &this->m_mutex); } - if (this->m_int0 == 2) { - this->m_value = 0; - } else if (this->m_int0 == 4) { - this->m_value = this->m_value - 1; + if (this->int0 == 2) { + this->m_value1 = 0; + } else if (this->int0 == 4) { + this->m_value1 = this->m_value1 - 1; } pthread_mutex_unlock(&this->m_mutex); diff --git a/storm/thread/SSyncObject.hpp b/storm/thread/SSyncObject.hpp index ef9c336..bf18bff 100644 --- a/storm/thread/SSyncObject.hpp +++ b/storm/thread/SSyncObject.hpp @@ -19,10 +19,11 @@ class SSyncObject { #endif #if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX) - int32_t m_int0 = 6; - int32_t m_value; - pthread_cond_t m_cond; + int32_t int0 = 6; + int32_t m_value1; + int32_t m_value2; pthread_mutex_t m_mutex; + pthread_cond_t m_cond; #endif // Member functions diff --git a/storm/thread/SThread.cpp b/storm/thread/SThread.cpp index 92f8a07..d738472 100644 --- a/storm/thread/SThread.cpp +++ b/storm/thread/SThread.cpp @@ -8,8 +8,8 @@ int32_t SThread::Create(uint32_t (*threadProc)(void*), void* param, SThread& thr #endif #if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX) - thread.m_int0 = 5; - thread.m_value = 0; + thread.int0 = 5; + thread.m_value1 = 0; pthread_cond_init(&thread.m_cond, nullptr); uint32_t v8; diff --git a/storm/thread/mac/S_Thread.mm b/storm/thread/mac/S_Thread.mm index 2550959..1adf9e0 100644 --- a/storm/thread/mac/S_Thread.mm +++ b/storm/thread/mac/S_Thread.mm @@ -32,7 +32,7 @@ uint32_t S_Thread::s_SLaunchThread(void* threadParam) { if (params->syncObject) { pthread_mutex_lock(¶ms->syncObject->m_mutex); - params->syncObject->m_value = 1; + params->syncObject->m_value1 = 1; pthread_mutex_unlock(¶ms->syncObject->m_mutex); pthread_cond_signal(¶ms->syncObject->m_cond); } diff --git a/storm/thread/mac/Thread.mm b/storm/thread/mac/Thread.mm index f2393ad..b1eaf44 100644 --- a/storm/thread/mac/Thread.mm +++ b/storm/thread/mac/Thread.mm @@ -48,7 +48,7 @@ int32_t SCreateThread(uint32_t (*threadProc)(void*), void* threadParam, void* a3 params->syncObject = syncObject; if (syncObject) { - syncObject->m_value = 0; + syncObject->m_value1 = 0; pthread_cond_init(&syncObject->m_cond, nullptr); pthread_mutex_init(&syncObject->m_mutex, nullptr); }