mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
15 lines
456 B
C++
15 lines
456 B
C++
#include "storm/thread/SSemaphore.hpp"
|
|
|
|
SSemaphore::SSemaphore(uint32_t initialCount, uint32_t maximumCount)
|
|
: SSyncObject() {
|
|
#if defined(WHOA_SYSTEM_WIN)
|
|
this->m_opaqueData = CreateSemaphoreA(nullptr, initialCount, maximumCount, nullptr);
|
|
#endif
|
|
|
|
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
|
|
this->m_value1 = initialCount;
|
|
this->m_value2 = maximumCount;
|
|
this->int0 = 4;
|
|
pthread_cond_init(&this->m_cond, 0);
|
|
#endif
|
|
}
|