feat(thread): add writing overloads for CCritSect

This commit is contained in:
fallenoak 2023-03-27 16:50:33 -05:00
parent a500c34d45
commit c7379a8509
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
2 changed files with 12 additions and 0 deletions

View file

@ -30,6 +30,11 @@ void CCritSect::Enter() {
#endif
}
void CCritSect::Enter(int32_t forWriting) {
// Overload to provide compatibility with CSRWLock
this->Enter();
}
void CCritSect::Leave() {
#if defined(WHOA_SYSTEM_WIN)
LeaveCriticalSection(&this->m_critsect);
@ -39,3 +44,8 @@ void CCritSect::Leave() {
pthread_mutex_unlock(&this->m_critsect);
#endif
}
void CCritSect::Leave(int32_t fromWriting) {
// Overload to provide compatibility with CSRWLock
this->Leave();
}

View file

@ -15,7 +15,9 @@ class CCritSect {
CCritSect();
~CCritSect();
void Enter();
void Enter(int32_t forWriting);
void Leave();
void Leave(int32_t fromWriting);
private:
// Member variables