fix(thread): correct layout of SSyncObject

This commit is contained in:
fallenoak 2021-08-09 00:13:52 -05:00
parent 0d00bd3ae4
commit 83cd9b05c0
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
6 changed files with 25 additions and 24 deletions

View file

@ -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);