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

Unified Diff: base/waitable_event_watcher.h

Issue 53026: POSIX: allow WaitableEvents to be deleted while watching them. (Closed)
Patch Set: Addressing Jeremy's comments Created 11 years, 9 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 | « base/waitable_event_posix.cc ('k') | base/waitable_event_watcher_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/waitable_event_watcher.h
diff --git a/base/waitable_event_watcher.h b/base/waitable_event_watcher.h
index 1b4994432987d77dcfdcaafb8b9844505959839a..94c3fdb599c4c798f1acc16623ddbae98c5da418 100644
--- a/base/waitable_event_watcher.h
+++ b/base/waitable_event_watcher.h
@@ -11,11 +11,11 @@
#include "base/object_watcher.h"
#else
#include "base/message_loop.h"
+#include "base/waitable_event.h"
#endif
namespace base {
-class WaitableEvent;
class Flag;
class AsyncWaiter;
class AsyncCallbackTask;
@@ -51,6 +51,9 @@ class AsyncCallbackTask;
// occurs just before a WaitableEventWatcher is deleted. There is currently no
// safe way to stop watching an automatic reset WaitableEvent without possibly
// missing a signal.
+//
+// NOTE: you /are/ allowed to delete the WaitableEvent while still waiting on
+// it with a Watcher. It will act as if the event was never signaled.
// -----------------------------------------------------------------------------
class WaitableEventWatcher
@@ -140,6 +143,7 @@ class WaitableEventWatcher
scoped_refptr<Flag> cancel_flag_;
AsyncWaiter* waiter_;
AsyncCallbackTask* callback_task_;
+ scoped_refptr<WaitableEvent::WaitableEventKernel> kernel_;
#endif
};
« no previous file with comments | « base/waitable_event_posix.cc ('k') | base/waitable_event_watcher_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698