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

Issue 419773002: Take extra lock in base::WaitableEvent::WaitMany. (Closed)

Created:
6 years, 5 months ago by yhirano
Modified:
6 years, 4 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, hiroshige
Project:
chromium
Visibility:
Public.

Description

Take extra lock in base::WaitableEvent::WaitMany. Currently WaitMany doesn't ensure that the corresponding |Signal| is done when the WaitMany call is returned. That is problematic when we share the event over threads and want to wait for detaching it in order to delete it after that. BUG=397435 R=agl@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288005

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 2

Patch Set 4 : Add a test and revert the change to see if the test fails. #

Patch Set 5 : restore the change. #

Patch Set 6 : WIP #

Patch Set 7 : WIP #

Patch Set 8 : #

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -7 lines) Patch
M base/synchronization/waitable_event.h View 1 2 2 chunks +12 lines, -2 lines 0 comments Download
M base/synchronization/waitable_event_posix.cc View 1 2 3 4 5 6 7 2 chunks +10 lines, -0 lines 0 comments Download
M base/synchronization/waitable_event_unittest.cc View 1 2 3 4 5 7 8 2 chunks +27 lines, -5 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
yhirano
6 years, 5 months ago (2014-07-25 07:48:28 UTC) #1
agl
Is the situation that you have a thread waiting on a WaitableEvent and you want ...
6 years, 5 months ago (2014-07-25 17:32:46 UTC) #2
yhirano
https://codereview.chromium.org/419773002/diff/1/base/synchronization/waitable_event_posix.cc File base/synchronization/waitable_event_posix.cc (right): https://codereview.chromium.org/419773002/diff/1/base/synchronization/waitable_event_posix.cc#newcode293 base/synchronization/waitable_event_posix.cc:293: // We acquire and release the lock in order ...
6 years, 4 months ago (2014-07-29 06:48:11 UTC) #3
agl
https://codereview.chromium.org/419773002/diff/1/base/synchronization/waitable_event_posix.cc File base/synchronization/waitable_event_posix.cc (right): https://codereview.chromium.org/419773002/diff/1/base/synchronization/waitable_event_posix.cc#newcode293 base/synchronization/waitable_event_posix.cc:293: // We acquire and release the lock in order ...
6 years, 4 months ago (2014-07-29 21:39:50 UTC) #4
yhirano
https://codereview.chromium.org/419773002/diff/1/base/synchronization/waitable_event_posix.cc File base/synchronization/waitable_event_posix.cc (right): https://codereview.chromium.org/419773002/diff/1/base/synchronization/waitable_event_posix.cc#newcode293 base/synchronization/waitable_event_posix.cc:293: // We acquire and release the lock in order ...
6 years, 4 months ago (2014-07-30 11:43:45 UTC) #5
agl
On 2014/07/30 11:43:45, yhirano wrote: > Hmm... I can easily find multiple code relying on ...
6 years, 4 months ago (2014-07-30 16:40:53 UTC) #6
yhirano
How about taking the lock in the destructor? As base::Lock asserts that it must not ...
6 years, 4 months ago (2014-07-31 11:48:13 UTC) #7
yhirano
https://codereview.chromium.org/419773002/diff/20001/base/synchronization/waitable_event_posix.cc File base/synchronization/waitable_event_posix.cc (right): https://codereview.chromium.org/419773002/diff/20001/base/synchronization/waitable_event_posix.cc#newcode45 base/synchronization/waitable_event_posix.cc:45: // TODO(yhirano): Write comment here I will add a ...
6 years, 4 months ago (2014-07-31 11:48:20 UTC) #8
agl
Although I think that taking a lock in the destructor should work, I think your ...
6 years, 4 months ago (2014-08-01 01:00:07 UTC) #9
yhirano
Thank you, I copied your comments.
6 years, 4 months ago (2014-08-04 08:57:04 UTC) #10
agl
lgtm
6 years, 4 months ago (2014-08-04 18:01:33 UTC) #11
yhirano
+willchan for OWNER review.
6 years, 4 months ago (2014-08-05 00:53:01 UTC) #12
willchan no longer on Chromium
I'm looking right now, but the first thing is, do we have a test for ...
6 years, 4 months ago (2014-08-05 16:47:22 UTC) #13
willchan no longer on Chromium
I don't understand why [1] and [2] violate agl's assertion that Wait()'s return happens after ...
6 years, 4 months ago (2014-08-05 16:57:40 UTC) #14
willchan no longer on Chromium
agl@ walked by and explained the difference between the weaker and stronger invariant, the subtlety ...
6 years, 4 months ago (2014-08-05 17:26:27 UTC) #15
yhirano
https://codereview.chromium.org/419773002/diff/40001/base/synchronization/waitable_event_posix.cc File base/synchronization/waitable_event_posix.cc (right): https://codereview.chromium.org/419773002/diff/40001/base/synchronization/waitable_event_posix.cc#newcode298 base/synchronization/waitable_event_posix.cc:298: // By taking this lock here we ensure that ...
6 years, 4 months ago (2014-08-06 11:49:49 UTC) #16
willchan no longer on Chromium
lgtm
6 years, 4 months ago (2014-08-06 20:39:35 UTC) #17
yhirano
The CQ bit was checked by yhirano@chromium.org
6 years, 4 months ago (2014-08-07 01:10:22 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yhirano@chromium.org/419773002/180001
6 years, 4 months ago (2014-08-07 01:12:57 UTC) #19
commit-bot: I haz the power
6 years, 4 months ago (2014-08-07 08:09:16 UTC) #20
Message was sent while issue was closed.
Change committed as 288005

Powered by Google App Engine
This is Rietveld 408576698