aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/event.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/system/event.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/event.h')
-rw-r--r--util/system/event.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/util/system/event.h b/util/system/event.h
index cab2fc478a..05aadb2cef 100644
--- a/util/system/event.h
+++ b/util/system/event.h
@@ -4,17 +4,17 @@
#include <util/datetime/base.h>
struct TEventResetType {
- enum ResetMode {
- rAuto, // the state will be nonsignaled after Wait() returns
- rManual, // we need call Reset() to set the state to nonsignaled.
- };
+ enum ResetMode {
+ rAuto, // the state will be nonsignaled after Wait() returns
+ rManual, // we need call Reset() to set the state to nonsignaled.
+ };
};
/**
* DEPRECATED!
*
* Use TAutoEvent, TManualEvent for the direct replacement.
- * Use TManualEvent to prevent SEGFAULT (http://nga.at.yandex-team.ru/5772).
+ * Use TManualEvent to prevent SEGFAULT (http://nga.at.yandex-team.ru/5772).
*/
class TSystemEvent: public TEventResetType {
public:
@@ -27,40 +27,40 @@ public:
void Reset() noexcept;
void Signal() noexcept;
- /*
- * return true if signaled, false if timed out.
- */
+ /*
+ * return true if signaled, false if timed out.
+ */
bool WaitD(TInstant deadLine) noexcept;
-
- /*
- * return true if signaled, false if timed out.
- */
+
+ /*
+ * return true if signaled, false if timed out.
+ */
inline bool WaitT(TDuration timeOut) noexcept {
- return WaitD(timeOut.ToDeadLine());
- }
-
- /*
- * wait infinite time
- */
+ return WaitD(timeOut.ToDeadLine());
+ }
+
+ /*
+ * wait infinite time
+ */
inline void WaitI() noexcept {
- WaitD(TInstant::Max());
- }
-
- //return true if signaled, false if timed out.
+ WaitD(TInstant::Max());
+ }
+
+ //return true if signaled, false if timed out.
inline bool Wait(ui32 timer) noexcept {
- return WaitT(TDuration::MilliSeconds(timer));
- }
-
+ return WaitT(TDuration::MilliSeconds(timer));
+ }
+
inline bool Wait() noexcept {
- WaitI();
-
- return true;
- }
-
-private:
- class TEvImpl;
+ WaitI();
+
+ return true;
+ }
+
+private:
+ class TEvImpl;
TIntrusivePtr<TEvImpl> EvImpl_;
-};
+};
class TAutoEvent: public TSystemEvent {
public: