squall/storm/thread/SCritSect.cpp
2020-11-01 17:45:45 -06:00

21 lines
460 B
C++

#include "storm/thread/SCritSect.hpp"
void SCritSect::Enter() {
#if defined(PLATFORM_WIN)
EnterCriticalSection(&this->m_opaqueData);
#endif
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
pthread_mutex_lock(&this->m_mutex);
#endif
}
void SCritSect::Leave() {
#if defined(PLATFORM_WIN)
LeaveCriticalSection(&this->m_opaqueData);
#endif
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
pthread_mutex_unlock(&this->m_mutex);
#endif
}