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

Issue 2303943003: Ensure that |Thread::id_| is only accessed when an happens-after relationship has been established … (Closed)

Created:
4 years, 3 months ago by gab
Modified:
4 years, 3 months ago
Reviewers:
danakj
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure that |Thread::id_| is only accessed when an happens-after relationship has been established with its write. In practice this mostly means only reading it while |id_event_| is signaled. Also don't AssertWaitAllowed() in WaitableEvent::TimedWait(0) on Windows to allow WaitableEvent::IsSignaled() to be called on threads which aren't allowed to wait. From MSDN: The time-out interval, in milliseconds. If a nonzero value is specified, the function waits until the object is signaled or the interval elapses. If dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled; it always returns immediately. If dwMilliseconds is INFINITE, the function will return only when the object is signaled. BUG=638578 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_tsan_rel_ng Committed: https://crrev.com/3e09ce122b81dadacd6ffde73bee126952ff0d1f Cr-Commit-Position: refs/heads/master@{#417117}

Patch Set 1 #

Patch Set 2 : Only AssertWaitAllowed() in WaitableEvent::TimedWait if time is non-zero #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -6 lines) Patch
M base/synchronization/waitable_event_win.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M base/threading/thread.h View 3 chunks +6 lines, -5 lines 0 comments Download
M base/threading/thread.cc View 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (10 generated)
gab
Dana PTAL, thanks!
4 years, 3 months ago (2016-09-02 14:26:56 UTC) #5
danakj
Should we DCHECK signaled when we look at the id_ elsewhere too, like Thread::Run?
4 years, 3 months ago (2016-09-06 21:14:42 UTC) #8
gab
On 2016/09/06 21:14:42, danakj wrote: > Should we DCHECK signaled when we look at the ...
4 years, 3 months ago (2016-09-07 13:30:52 UTC) #9
danakj
Oops.. I thought only the header changed I have no idea what happened LGTM
4 years, 3 months ago (2016-09-07 20:34:41 UTC) #10
gab
FYI, had to tweak AssertWaitAllowed() in waitable_event_win.cc to not assert if wait time is zero ...
4 years, 3 months ago (2016-09-07 20:48:00 UTC) #11
danakj
LGTM thx
4 years, 3 months ago (2016-09-07 20:59:00 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2303943003/20001
4 years, 3 months ago (2016-09-07 20:59:49 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 3 months ago (2016-09-07 23:41:26 UTC) #17
commit-bot: I haz the power
4 years, 3 months ago (2016-09-07 23:43:21 UTC) #19
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/3e09ce122b81dadacd6ffde73bee126952ff0d1f
Cr-Commit-Position: refs/heads/master@{#417117}

Powered by Google App Engine
This is Rietveld 408576698