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

Issue 53026: POSIX: allow WaitableEvents to be deleted while watching them. (Closed)

Created:
11 years, 9 months ago by agl
Modified:
9 years, 7 months ago
Reviewers:
jam, jeremy
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

POSIX: allow WaitableEvents to be deleted while watching them. 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. Currently, on POSIX, one couldn't use WaitableEventWatcher to watch an event which gets deleted. This mismatch has bitten us several times now. This patch allows WaitableEvents to be deleted while a WaitableEventWatcher is still watching them. It applies only to watchers, the usual Wait() and WaitMany() calls still require that all their target be valid until the end of the call. http://crbug.com/8809

Patch Set 1 #

Patch Set 2 : ... #

Patch Set 3 : ... #

Total comments: 4

Patch Set 4 : Addressing Jeremy's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -64 lines) Patch
M base/waitable_event.h View 1 2 3 5 chunks +30 lines, -8 lines 0 comments Download
M base/waitable_event_posix.cc View 10 chunks +38 lines, -44 lines 0 comments Download
M base/waitable_event_watcher.h View 3 chunks +5 lines, -1 line 0 comments Download
M base/waitable_event_watcher_posix.cc View 1 2 5 chunks +13 lines, -11 lines 0 comments Download
M base/waitable_event_watcher_unittest.cc View 2 chunks +22 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
agl
11 years, 9 months ago (2009-03-24 22:54:35 UTC) #1
jeremy
LGTM! Could you reference http://crbug.com/8809 from the CL description? http://codereview.chromium.org/53026/diff/1012/7 File base/waitable_event.h (right): http://codereview.chromium.org/53026/diff/1012/7#newcode141 Line ...
11 years, 9 months ago (2009-03-24 23:11:57 UTC) #2
agl
http://codereview.chromium.org/53026/diff/1012/7 File base/waitable_event.h (right): http://codereview.chromium.org/53026/diff/1012/7#newcode141 Line 141: // WaitableEventWatchers may then take a referenence and ...
11 years, 9 months ago (2009-03-24 23:17:04 UTC) #3
jam
11 years, 9 months ago (2009-03-24 23:21:04 UTC) #4
lgtm

I'm curious why you didn't just make WaitableEvent itself RefCounted?

Powered by Google App Engine
This is Rietveld 408576698