diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 9123176b341b6f2658cff5132482b8237c1416c8 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/coroutine/engine/mutex.h | |
parent | 59e19371de37995fcb36beb16cd6ec030af960bc (diff) | |
download | ydb-9123176b341b6f2658cff5132482b8237c1416c8.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/coroutine/engine/mutex.h')
-rw-r--r-- | library/cpp/coroutine/engine/mutex.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/coroutine/engine/mutex.h b/library/cpp/coroutine/engine/mutex.h index 5a73e13c2c..93e9119503 100644 --- a/library/cpp/coroutine/engine/mutex.h +++ b/library/cpp/coroutine/engine/mutex.h @@ -1,20 +1,20 @@ -#pragma once +#pragma once + +#include "impl.h" +#include "events.h" -#include "impl.h" -#include "events.h" - class TContMutex { public: - TContMutex() noexcept + TContMutex() noexcept : Token_(true) { } - ~TContMutex() { + ~TContMutex() { Y_ASSERT(Token_); } - int LockD(TCont* current, TInstant deadline) { + int LockD(TCont* current, TInstant deadline) { while (!Token_) { const int ret = WaitQueue_.WaitD(current, deadline); @@ -28,15 +28,15 @@ public: return 0; } - int LockT(TCont* current, TDuration timeout) { + int LockT(TCont* current, TDuration timeout) { return LockD(current, timeout.ToDeadLine()); } - int LockI(TCont* current) { + int LockI(TCont* current) { return LockD(current, TInstant::Max()); } - void UnLock() noexcept { + void UnLock() noexcept { Y_ASSERT(!Token_); Token_ = true; |