Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2320)

Unified Diff: base/synchronization/waitable_event.h

Issue 2020043002: Make WaitableEvent's constructor enum-based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move enum constructor in _posix.cc Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/synchronization/waitable_event_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/waitable_event.h
diff --git a/base/synchronization/waitable_event.h b/base/synchronization/waitable_event.h
index b5d91d00b51fd3b2899f39a4707dcef5ebd3424c..a4ca312174087b4f2a9aec34ebcf31f5507012ef 100644
--- a/base/synchronization/waitable_event.h
+++ b/base/synchronization/waitable_event.h
@@ -43,10 +43,25 @@ class TimeDelta;
// be better off just using an Windows event directly.
class BASE_EXPORT WaitableEvent {
public:
+ // Indicates whether a WaitableEvent should automatically reset the event
+ // state after a single waiting thread has been released or remain signaled
+ // until Reset() is manually invoked.
+ enum class ResetPolicy { MANUAL, AUTOMATIC };
+
+ // Indicates whether a new WaitableEvent should start in a signaled state or
+ // not.
+ enum class InitialState { SIGNALED, NOT_SIGNALED };
+
+ // Constructs a WaitableEvent with policy and initial state as detailed in
+ // the above enums.
+ WaitableEvent(ResetPolicy reset_policy, InitialState initial_state);
+
// If manual_reset is true, then to set the event state to non-signaled, a
// consumer must call the Reset method. If this parameter is false, then the
// system automatically resets the event state to non-signaled after a single
// waiting thread has been released.
+ // DEPRECATED: Use the enum-based constructor instead (full removal tracked in
+ // http://crbug.com/612843).
WaitableEvent(bool manual_reset, bool initially_signaled);
#if defined(OS_WIN)
« no previous file with comments | « no previous file | base/synchronization/waitable_event_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698