diff options
author | tejblum <tejblum@yandex-team.ru> | 2022-02-10 16:48:02 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:02 +0300 |
commit | 6ab7e5f5ada0643a48d393717f443bd548706ffc (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system/rwlock.h | |
parent | 2bf39531b4f50b889e946ac4866018678a4fb281 (diff) | |
download | ydb-6ab7e5f5ada0643a48d393717f443bd548706ffc.tar.gz |
Restoring authorship annotation for <tejblum@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/rwlock.h')
-rw-r--r-- | util/system/rwlock.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/system/rwlock.h b/util/system/rwlock.h index c4b28b06a5..0bb9b3fe1c 100644 --- a/util/system/rwlock.h +++ b/util/system/rwlock.h @@ -1,25 +1,25 @@ #pragma once - + #include "guard.h" #include "defaults.h" - + #include <util/generic/ptr.h> class TRWMutex { public: TRWMutex(); ~TRWMutex(); - + void AcquireRead() noexcept; bool TryAcquireRead() noexcept; void ReleaseRead() noexcept; - + void AcquireWrite() noexcept; bool TryAcquireWrite() noexcept; void ReleaseWrite() noexcept; void Release() noexcept; - + private: class TImpl; THolder<TImpl> Impl_; @@ -34,8 +34,8 @@ struct TReadGuardOps { static inline void Release(T* t) noexcept { t->ReleaseRead(); } -}; - +}; + template <class T> struct TTryReadGuardOps: public TReadGuardOps<T> { static inline bool TryAcquire(T* t) noexcept { @@ -52,8 +52,8 @@ struct TWriteGuardOps { static inline void Release(T* t) noexcept { t->ReleaseWrite(); } -}; - +}; + template <class T> struct TTryWriteGuardOps: public TWriteGuardOps<T> { static inline bool TryAcquire(T* t) noexcept { |