diff options
| author | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
|---|---|---|
| committer | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
| commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
| tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/messagebus/extra_ref.h | |
| parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
fix ya.make
Diffstat (limited to 'library/cpp/messagebus/extra_ref.h')
| -rw-r--r-- | library/cpp/messagebus/extra_ref.h | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/library/cpp/messagebus/extra_ref.h b/library/cpp/messagebus/extra_ref.h deleted file mode 100644 index 29271232668..00000000000 --- a/library/cpp/messagebus/extra_ref.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include <util/system/yassert.h> - -class TExtraRef { - TAtomic Holds; - -public: - TExtraRef() - : Holds(false) - { - } - ~TExtraRef() { - Y_VERIFY(!Holds); - } - - template <typename TThis> - void Retain(TThis* thiz) { - if (AtomicGet(Holds)) { - return; - } - if (AtomicCas(&Holds, 1, 0)) { - thiz->Ref(); - } - } - - template <typename TThis> - void Release(TThis* thiz) { - if (!AtomicGet(Holds)) { - return; - } - if (AtomicCas(&Holds, 0, 1)) { - thiz->UnRef(); - } - } -}; |
