diff options
author | darkk <darkk@yandex-team.ru> | 2022-02-10 16:49:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:49 +0300 |
commit | 53d07fb9e28d179add32cd299c9341bf8a231a31 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/refcount.h | |
parent | f772ca38c4a395b911129411c06b2074d69d826f (diff) | |
download | ydb-53d07fb9e28d179add32cd299c9341bf8a231a31.tar.gz |
Restoring authorship annotation for <darkk@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/refcount.h')
-rw-r--r-- | util/generic/refcount.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/generic/refcount.h b/util/generic/refcount.h index 2f8ce6499a..966e853b77 100644 --- a/util/generic/refcount.h +++ b/util/generic/refcount.h @@ -89,17 +89,17 @@ using TSimpleCounter = TSimpleCounterTemplate<TCheckPolicy>; // Use this one if you do want to share the pointer between threads, omit thread checks and do the synchronization yourself using TExplicitSimpleCounter = TSimpleCounterTemplate<TNoCheckPolicy>; -template <class TCounterCheckPolicy> -struct TCommonLockOps<TSimpleCounterTemplate<TCounterCheckPolicy>> { +template <class TCounterCheckPolicy> +struct TCommonLockOps<TSimpleCounterTemplate<TCounterCheckPolicy>> { static inline void Acquire(TSimpleCounterTemplate<TCounterCheckPolicy>* t) noexcept { - t->Inc(); - } - + t->Inc(); + } + static inline void Release(TSimpleCounterTemplate<TCounterCheckPolicy>* t) noexcept { - t->Dec(); - } -}; - + t->Dec(); + } +}; + class TAtomicCounter { public: inline TAtomicCounter(long initial = 0) noexcept |