From c7379a85095edb4b1730be06d8d10441de4712a8 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 27 Mar 2023 16:50:33 -0500 Subject: [PATCH] feat(thread): add writing overloads for CCritSect --- storm/thread/CCritSect.cpp | 10 ++++++++++ storm/thread/CCritSect.hpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/storm/thread/CCritSect.cpp b/storm/thread/CCritSect.cpp index 592dd76..ea3b0af 100644 --- a/storm/thread/CCritSect.cpp +++ b/storm/thread/CCritSect.cpp @@ -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(); +} diff --git a/storm/thread/CCritSect.hpp b/storm/thread/CCritSect.hpp index 662eda9..79d24d3 100644 --- a/storm/thread/CCritSect.hpp +++ b/storm/thread/CCritSect.hpp @@ -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