mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(thread): add writing overloads for CCritSect
This commit is contained in:
parent
a500c34d45
commit
c7379a8509
2 changed files with 12 additions and 0 deletions
|
|
@ -30,6 +30,11 @@ void CCritSect::Enter() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCritSect::Enter(int32_t forWriting) {
|
||||||
|
// Overload to provide compatibility with CSRWLock
|
||||||
|
this->Enter();
|
||||||
|
}
|
||||||
|
|
||||||
void CCritSect::Leave() {
|
void CCritSect::Leave() {
|
||||||
#if defined(WHOA_SYSTEM_WIN)
|
#if defined(WHOA_SYSTEM_WIN)
|
||||||
LeaveCriticalSection(&this->m_critsect);
|
LeaveCriticalSection(&this->m_critsect);
|
||||||
|
|
@ -39,3 +44,8 @@ void CCritSect::Leave() {
|
||||||
pthread_mutex_unlock(&this->m_critsect);
|
pthread_mutex_unlock(&this->m_critsect);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCritSect::Leave(int32_t fromWriting) {
|
||||||
|
// Overload to provide compatibility with CSRWLock
|
||||||
|
this->Leave();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ class CCritSect {
|
||||||
CCritSect();
|
CCritSect();
|
||||||
~CCritSect();
|
~CCritSect();
|
||||||
void Enter();
|
void Enter();
|
||||||
|
void Enter(int32_t forWriting);
|
||||||
void Leave();
|
void Leave();
|
||||||
|
void Leave(int32_t fromWriting);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Member variables
|
// Member variables
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue