aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/sem.h
diff options
context:
space:
mode:
authorleo <leo@yandex-team.ru>2022-02-10 16:46:40 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:40 +0300
commit99609724f661f7e21d1cb08e8d80e87c3632fdb3 (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /util/system/sem.h
parent980edcd3304699edf9d4e4d6a656e585028e2a72 (diff)
downloadydb-99609724f661f7e21d1cb08e8d80e87c3632fdb3.tar.gz
Restoring authorship annotation for <leo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/sem.h')
-rw-r--r--util/system/sem.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/util/system/sem.h b/util/system/sem.h
index 545dc263be..0c964ad6b6 100644
--- a/util/system/sem.h
+++ b/util/system/sem.h
@@ -1,7 +1,7 @@
#pragma once
-
-#include "defaults.h"
-
+
+#include "defaults.h"
+
#include <util/generic/ptr.h>
//named sempahore
@@ -9,21 +9,21 @@ class TSemaphore {
public:
TSemaphore(const char* name, ui32 maxFreeCount);
~TSemaphore();
-
+
//Increase the semaphore counter.
void Release() noexcept;
-
+
//Keep a thread held while the semaphore counter is equal 0.
void Acquire() noexcept;
-
+
//Try to enter the semaphore gate. A non-blocking variant of Acquire.
//Returns 'true' if the semaphore counter decreased
bool TryAcquire() noexcept;
-
+
private:
class TImpl;
THolder<TImpl> Impl_;
-};
+};
//unnamed semaphore, faster, than previous
class TFastSemaphore {