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

Issue 2163753004: Rename CancellationFlag to AtomicFlag. (Closed)

Created:
4 years, 5 months ago by fdoray
Modified:
4 years, 5 months ago
CC:
chromium-reviews, fdoray+watch_chromium.org, gab+watch_chromium.org, gab, robliao+watch_chromium.org, robliao
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rename CancellationFlag to AtomicFlag. CancellationFlag is really just a flag that can be set once from one thread and read from a number of other threads. It is already used to express other things than cancellation (e.g. in after_startup_task_utils.cc) and could be used at a few places in base/task_scheduler instead of WaitableEvent. BUG=553459 Committed: https://crrev.com/ef191122f44b4d41a71c573bf785f6e1f68f4dfb Cr-Commit-Position: refs/heads/master@{#407475}

Patch Set 1 #

Patch Set 2 : self-review (remove unused includes) #

Total comments: 14

Patch Set 3 : CR danakj #3 #

Total comments: 6

Patch Set 4 : CR gab #5 #

Total comments: 2

Patch Set 5 : CR gab #8 (sleep before Set()) #

Total comments: 2

Patch Set 6 : CR danakj #11 (add comment about Thread's destructor in unit test) #

Patch Set 7 : restore task_tracker_unitttest.cc to make tests pass #

Patch Set 8 : fix dcheck death test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -205 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M base/base.gyp View 1 chunk +1 line, -1 line 0 comments Download
M base/base.gypi View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
A + base/synchronization/atomic_flag.h View 1 2 1 chunk +18 lines, -25 lines 0 comments Download
A + base/synchronization/atomic_flag.cc View 1 chunk +7 lines, -7 lines 0 comments Download
A + base/synchronization/atomic_flag_unittest.cc View 1 2 3 4 5 6 7 2 chunks +51 lines, -29 lines 0 comments Download
M base/synchronization/cancellation_flag.h View 1 2 1 chunk +6 lines, -35 lines 0 comments Download
D base/synchronization/cancellation_flag.cc View 1 chunk +0 lines, -26 lines 0 comments Download
D base/synchronization/cancellation_flag_unittest.cc View 1 chunk +0 lines, -65 lines 0 comments Download
M base/task_scheduler/task_scheduler_impl.h View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M base/task_scheduler/task_scheduler_impl.cc View 1 2 3 4 5 3 chunks +3 lines, -8 lines 0 comments Download
M chrome/browser/after_startup_task_utils.cc View 1 2 3 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 30 (12 generated)
fdoray
PTAL https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc File base/synchronization/atomic_flag_unittest.cc (right): https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc#newcode21 base/synchronization/atomic_flag_unittest.cc:21: ASSERT_DEBUG_DEATH(flag->Set(), ""); TODO: Use EXPECT_DCHECK_DEATH once https://codereview.chromium.org/2162053006/ lands.
4 years, 5 months ago (2016-07-20 16:24:11 UTC) #2
danakj
Thanks, this looks like a great idea. I didn't know this exists :) https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag.h File ...
4 years, 5 months ago (2016-07-20 19:21:01 UTC) #3
fdoray
PTAnL https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag.h File base/synchronization/atomic_flag.h (right): https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag.h#newcode30 base/synchronization/atomic_flag.h:30: // different thread testing IsSet() may erroneously read ...
4 years, 5 months ago (2016-07-21 13:08:33 UTC) #4
gab
Awesome, thanks for doing this, I love how I merely said "I wish this wasn't ...
4 years, 5 months ago (2016-07-21 13:27:13 UTC) #5
fdoray
danakj@/gab@: PTAnL https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc File base/synchronization/atomic_flag_unittest.cc (right): https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc#newcode67 base/synchronization/atomic_flag_unittest.cc:67: t.task_runner()->PostTask(FROM_HERE, Bind(&ExpectIsSet, &flag)); On 2016/07/21 13:27:12, gab ...
4 years, 5 months ago (2016-07-21 14:05:30 UTC) #6
gab
https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc File base/synchronization/atomic_flag_unittest.cc (right): https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc#newcode67 base/synchronization/atomic_flag_unittest.cc:67: t.task_runner()->PostTask(FROM_HERE, Bind(&ExpectIsSet, &flag)); On 2016/07/21 14:05:30, fdoray wrote: > ...
4 years, 5 months ago (2016-07-21 14:16:04 UTC) #8
fdoray
PTAnL https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc File base/synchronization/atomic_flag_unittest.cc (right): https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc#newcode67 base/synchronization/atomic_flag_unittest.cc:67: t.task_runner()->PostTask(FROM_HERE, Bind(&ExpectIsSet, &flag)); On 2016/07/21 14:16:04, gab wrote: ...
4 years, 5 months ago (2016-07-21 15:50:02 UTC) #9
gab
https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc File base/synchronization/atomic_flag_unittest.cc (right): https://codereview.chromium.org/2163753004/diff/20001/base/synchronization/atomic_flag_unittest.cc#newcode67 base/synchronization/atomic_flag_unittest.cc:67: t.task_runner()->PostTask(FROM_HERE, Bind(&ExpectIsSet, &flag)); On 2016/07/21 15:50:02, fdoray wrote: > ...
4 years, 5 months ago (2016-07-21 15:56:43 UTC) #10
danakj
LGTM https://codereview.chromium.org/2163753004/diff/80001/base/synchronization/atomic_flag.h File base/synchronization/atomic_flag.h (right): https://codereview.chromium.org/2163753004/diff/80001/base/synchronization/atomic_flag.h#newcode29 base/synchronization/atomic_flag.h:29: // Resets the flag. Be careful when using ...
4 years, 5 months ago (2016-07-21 19:21:43 UTC) #11
fdoray
jochen@: Can you review chrome/browser/after_startup_task_utils.cc? Thanks!
4 years, 5 months ago (2016-07-21 19:39:28 UTC) #13
jochen (gone - plz use gerrit)
lgtm
4 years, 5 months ago (2016-07-22 12:24:16 UTC) #14
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/2163753004/100001
4 years, 5 months ago (2016-07-22 12:46:31 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/195210)
4 years, 5 months ago (2016-07-22 13:13:15 UTC) #19
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/2163753004/120001
4 years, 5 months ago (2016-07-22 20:27:25 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/195525)
4 years, 5 months ago (2016-07-22 20:59:30 UTC) #24
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/2163753004/140001
4 years, 5 months ago (2016-07-25 13:38:12 UTC) #27
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 5 months ago (2016-07-25 14:43:31 UTC) #28
commit-bot: I haz the power
4 years, 5 months ago (2016-07-25 14:45:27 UTC) #30
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/ef191122f44b4d41a71c573bf785f6e1f68f4dfb
Cr-Commit-Position: refs/heads/master@{#407475}

Powered by Google App Engine
This is Rietveld 408576698