summaryrefslogtreecommitdiffstats
path: root/util/system/condvar.h
diff options
context:
space:
mode:
authoryazevnul <[email protected]>2022-02-10 16:46:46 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:46:46 +0300
commit8cbc307de0221f84c80c42dcbe07d40727537e2c (patch)
tree625d5a673015d1df891e051033e9fcde5c7be4e5 /util/system/condvar.h
parent30d1ef3941e0dc835be7609de5ebee66958f215a (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system/condvar.h')
-rw-r--r--util/system/condvar.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/util/system/condvar.h b/util/system/condvar.h
index 569162717cb..911ace52c6a 100644
--- a/util/system/condvar.h
+++ b/util/system/condvar.h
@@ -6,8 +6,8 @@
#include <util/generic/noncopyable.h>
#include <util/datetime/base.h>
-#include <utility>
-
+#include <utility>
+
class TCondVar {
public:
TCondVar();
@@ -19,30 +19,30 @@ public:
/*
* returns false if failed by timeout
*/
- bool WaitD(TMutex& m, TInstant deadline) noexcept;
-
- template <typename P>
- inline bool WaitD(TMutex& m, TInstant deadline, P pred) noexcept {
- while (!pred()) {
- if (!WaitD(m, deadline)) {
- return pred();
- }
- }
- return true;
- }
+ bool WaitD(TMutex& m, TInstant deadline) noexcept;
+ template <typename P>
+ inline bool WaitD(TMutex& m, TInstant deadline, P pred) noexcept {
+ while (!pred()) {
+ if (!WaitD(m, deadline)) {
+ return pred();
+ }
+ }
+ return true;
+ }
+
/*
* returns false if failed by timeout
*/
- inline bool WaitT(TMutex& m, TDuration timeout) noexcept {
- return WaitD(m, timeout.ToDeadLine());
- }
-
- template <typename P>
- inline bool WaitT(TMutex& m, TDuration timeout, P pred) noexcept {
- return WaitD(m, timeout.ToDeadLine(), std::move(pred));
+ inline bool WaitT(TMutex& m, TDuration timeout) noexcept {
+ return WaitD(m, timeout.ToDeadLine());
}
+ template <typename P>
+ inline bool WaitT(TMutex& m, TDuration timeout, P pred) noexcept {
+ return WaitD(m, timeout.ToDeadLine(), std::move(pred));
+ }
+
/*
* infinite wait
*/
@@ -50,21 +50,21 @@ public:
WaitD(m, TInstant::Max());
}
- template <typename P>
- inline void WaitI(TMutex& m, P pred) noexcept {
- WaitD(m, TInstant::Max(), std::move(pred));
- }
-
+ template <typename P>
+ inline void WaitI(TMutex& m, P pred) noexcept {
+ WaitD(m, TInstant::Max(), std::move(pred));
+ }
+
//deprecated
inline void Wait(TMutex& m) noexcept {
WaitI(m);
}
- template <typename P>
- inline void Wait(TMutex& m, P pred) noexcept {
- WaitI(m, std::move(pred));
- }
-
+ template <typename P>
+ inline void Wait(TMutex& m, P pred) noexcept {
+ WaitI(m, std::move(pred));
+ }
+
private:
class TImpl;
THolder<TImpl> Impl_;