diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /util/system/rwlock.h | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'util/system/rwlock.h')
-rw-r--r-- | util/system/rwlock.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/util/system/rwlock.h b/util/system/rwlock.h index 0bb9b3fe1c..b476837c92 100644 --- a/util/system/rwlock.h +++ b/util/system/rwlock.h @@ -8,17 +8,17 @@ class TRWMutex { public: TRWMutex(); - ~TRWMutex(); + ~TRWMutex(); - void AcquireRead() noexcept; - bool TryAcquireRead() noexcept; - void ReleaseRead() noexcept; + void AcquireRead() noexcept; + bool TryAcquireRead() noexcept; + void ReleaseRead() noexcept; - void AcquireWrite() noexcept; - bool TryAcquireWrite() noexcept; - void ReleaseWrite() noexcept; + void AcquireWrite() noexcept; + bool TryAcquireWrite() noexcept; + void ReleaseWrite() noexcept; - void Release() noexcept; + void Release() noexcept; private: class TImpl; @@ -27,36 +27,36 @@ private: template <class T> struct TReadGuardOps { - static inline void Acquire(T* t) noexcept { + static inline void Acquire(T* t) noexcept { t->AcquireRead(); } - static inline void Release(T* t) noexcept { + static inline void Release(T* t) noexcept { t->ReleaseRead(); } }; template <class T> struct TTryReadGuardOps: public TReadGuardOps<T> { - static inline bool TryAcquire(T* t) noexcept { + static inline bool TryAcquire(T* t) noexcept { return t->TryAcquireRead(); } }; template <class T> struct TWriteGuardOps { - static inline void Acquire(T* t) noexcept { + static inline void Acquire(T* t) noexcept { t->AcquireWrite(); } - static inline void Release(T* t) noexcept { + static inline void Release(T* t) noexcept { t->ReleaseWrite(); } }; template <class T> struct TTryWriteGuardOps: public TWriteGuardOps<T> { - static inline bool TryAcquire(T* t) noexcept { + static inline bool TryAcquire(T* t) noexcept { return t->TryAcquireWrite(); } }; |