diff options
Diffstat (limited to 'src/zencore/thread.cpp')
| -rw-r--r-- | src/zencore/thread.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/zencore/thread.cpp b/src/zencore/thread.cpp index 54459cbaa..f74791333 100644 --- a/src/zencore/thread.cpp +++ b/src/zencore/thread.cpp @@ -146,6 +146,12 @@ RwLock::AcquireShared() noexcept m_Mutex.lock_shared(); } +bool +RwLock::TryAcquireShared() noexcept +{ + return m_Mutex.try_lock_shared(); +} + void RwLock::ReleaseShared() noexcept { @@ -158,6 +164,12 @@ RwLock::AcquireExclusive() noexcept m_Mutex.lock(); } +bool +RwLock::TryAcquireExclusive() noexcept +{ + return m_Mutex.try_lock(); +} + void RwLock::ReleaseExclusive() noexcept { |