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

Unified Diff: base/synchronization/waitable_event.h

Issue 2839213002: [Synchronization] Fix a crash in WaitableEventWatcher (Closed)
Patch Set: Fix grammar in comments Created 3 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_watcher.h » ('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 e8caffeec32d5b7418a87ed563f9a86eaf0c92ce..716115cc777dd06822566b18c6235e61e6d41c9d 100644
--- a/base/synchronization/waitable_event.h
+++ b/base/synchronization/waitable_event.h
@@ -155,9 +155,12 @@ class BASE_EXPORT WaitableEvent {
#if defined(OS_WIN)
win::ScopedHandle handle_;
#else
- // On Windows, one can close a HANDLE which is currently being waited on. The
- // MSDN documentation says that the resulting behaviour is 'undefined', but
- // it doesn't crash. However, if we were to include the following members
+ // On Windows, you must not close a HANDLE which is currently being waited on.
+ // The MSDN documentation says that the resulting behaviour is 'undefined'.
+ // To solve that issue each WaitableEventWatcher duplicates the given event
+ // handle.
+
+ // However, if we were to include the following members
// directly then, on POSIX, one couldn't use WaitableEventWatcher to watch an
// event which gets deleted. This mismatch has bitten us several times now,
// so we have a kernel of the WaitableEvent, which is reference counted.
« no previous file with comments | « no previous file | base/synchronization/waitable_event_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698