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

Issue 2135413003: Add |joinable| to Thread::Options (Closed)

Created:
4 years, 5 months ago by gab
Modified:
4 years, 4 months ago
Reviewers:
danakj, Lei Zhang, jam
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add |joinable| to Thread::Options Required for MessageLoop backed non-joinable threads as discussed @ https://codereview.chromium.org/2103883004/#msg14 BUG=622400, 629716, 629139 Committed: https://crrev.com/9a473d5bfb65cffcb6576496232f66023af79fdf Cr-Commit-Position: refs/heads/master@{#409597}

Patch Set 1 #

Patch Set 2 : Extracted cleanup to https://codereview.chromium.org/2145463002 #

Patch Set 3 : rebase #

Patch Set 4 : self-review #

Total comments: 6

Patch Set 5 : merge up to r407479 #

Patch Set 6 : comment on nullptr #

Total comments: 2

Patch Set 7 : Add ThreadTest.StartTwiceNonJoinableNotAllowed #

Patch Set 8 : fix compile #

Total comments: 1

Patch Set 9 : fix race in ThreadTest.StartWithOptions_NonJoinable #

Patch Set 10 : Document set_message_loop() further #

Patch Set 11 : Also skip StopSoon() if there is no |run_loop_| to support set_message_loop() use case for TestBrow… #

Patch Set 12 : Checking |run_loop_| doesn't work as ThreadMain could have not hit yet in tests -- introduce |using… #

Total comments: 2

Patch Set 13 : Add ThreadTest.ExternalMessageLoop #

Patch Set 14 : Init() => InstallMessageLoop() -- Init was already used on Thread::... #

Total comments: 2

Patch Set 15 : Add ThreadTest.DestroyWhileRunning* tests which fail at the moment (#msg62) #

Patch Set 16 : Force non-joinable threads to be leaked for now (or otherwise carefully/undeterministically wound d… #

Patch Set 17 : Rebase on dependent AtomicFlag CL #

Patch Set 18 : fix |thread_main_exited_| check when thread is destroyed without ever starting #

Patch Set 19 : update dependent CL #

Patch Set 20 : update dependent CL #

Total comments: 4

Patch Set 21 : DCHECK(message_loop); in SetMessageLoop() + |thread_main_exited_flag_| #

Patch Set 22 : Force explicit leak of non-joinable threads for now. #

Patch Set 23 : merge up to r408965 #

Patch Set 24 : adapt merge with most recent changes #

Patch Set 25 : ignore SetMessageLoop(nullptr) for now -- added TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+259 lines, -23 lines) Patch
M base/threading/platform_thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +6 lines, -0 lines 0 comments Download
M base/threading/platform_thread_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +11 lines, -3 lines 0 comments Download
M base/threading/platform_thread_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +10 lines, -2 lines 0 comments Download
M base/threading/thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 6 chunks +25 lines, -8 lines 0 comments Download
M base/threading/thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 7 chunks +46 lines, -5 lines 0 comments Download
M base/threading/thread_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 8 chunks +159 lines, -3 lines 0 comments Download
M content/browser/browser_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -1 line 0 comments Download
M ios/web/web_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 127 (87 generated)
gab
Dana PTAL (this is based on https://codereview.chromium.org/2145463002/), thanks!
4 years, 5 months ago (2016-07-22 16:17:16 UTC) #13
danakj
https://codereview.chromium.org/2135413003/diff/140001/base/threading/platform_thread_win.cc File base/threading/platform_thread_win.cc (right): https://codereview.chromium.org/2135413003/diff/140001/base/threading/platform_thread_win.cc#newcode207 base/threading/platform_thread_win.cc:207: return CreateThreadInternal(stack_size, delegate, nullptr, priority); mind a comment on ...
4 years, 5 months ago (2016-07-22 21:00:40 UTC) #14
gab
Thanks, replies below. https://codereview.chromium.org/2135413003/diff/140001/base/threading/platform_thread_win.cc File base/threading/platform_thread_win.cc (right): https://codereview.chromium.org/2135413003/diff/140001/base/threading/platform_thread_win.cc#newcode207 base/threading/platform_thread_win.cc:207: return CreateThreadInternal(stack_size, delegate, nullptr, priority); On ...
4 years, 5 months ago (2016-07-25 16:07:40 UTC) #15
danakj
https://codereview.chromium.org/2135413003/diff/180001/base/threading/thread.h File base/threading/thread.h (right): https://codereview.chromium.org/2135413003/diff/180001/base/threading/thread.h#newcode144 base/threading/thread.h:144: // threads are not re-usable. Is there some DCHECK ...
4 years, 5 months ago (2016-07-25 18:32:53 UTC) #20
gab
https://codereview.chromium.org/2135413003/diff/180001/base/threading/thread.h File base/threading/thread.h (right): https://codereview.chromium.org/2135413003/diff/180001/base/threading/thread.h#newcode144 base/threading/thread.h:144: // threads are not re-usable. On 2016/07/25 18:32:53, danakj ...
4 years, 5 months ago (2016-07-25 19:18:29 UTC) #21
danakj
Thanks, LGTM
4 years, 5 months ago (2016-07-25 21:08:34 UTC) #36
gab
https://codereview.chromium.org/2135413003/diff/260001/base/threading/thread.cc File base/threading/thread.cc (right): https://codereview.chromium.org/2135413003/diff/260001/base/threading/thread.cc#newcode151 base/threading/thread.cc:151: StopSoon(); Note: this is causing try job failures in ...
4 years, 5 months ago (2016-07-25 21:09:00 UTC) #37
gab
On 2016/07/25 21:09:00, gab wrote: > https://codereview.chromium.org/2135413003/diff/260001/base/threading/thread.cc > File base/threading/thread.cc (right): > > https://codereview.chromium.org/2135413003/diff/260001/base/threading/thread.cc#newcode151 > ...
4 years, 4 months ago (2016-07-26 16:36:46 UTC) #38
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/2135413003/320001
4 years, 4 months ago (2016-07-26 16:37:10 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/110836)
4 years, 4 months ago (2016-07-26 17:57:48 UTC) #43
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/2135413003/320001
4 years, 4 months ago (2016-07-26 18:06:41 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/41663)
4 years, 4 months ago (2016-07-26 18:20:24 UTC) #47
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/2135413003/320001
4 years, 4 months ago (2016-07-26 18:49:18 UTC) #49
gab
On 2016/07/26 16:36:46, gab wrote: > On 2016/07/25 21:09:00, gab wrote: > > > https://codereview.chromium.org/2135413003/diff/260001/base/threading/thread.cc ...
4 years, 4 months ago (2016-07-26 19:17:55 UTC) #51
danakj
https://codereview.chromium.org/2135413003/diff/340001/base/threading/thread.cc File base/threading/thread.cc (right): https://codereview.chromium.org/2135413003/diff/340001/base/threading/thread.cc#newcode180 base/threading/thread.cc:180: stopping_ = true; Is it not weird that Thread ...
4 years, 4 months ago (2016-07-26 19:54:25 UTC) #54
gab
Added ThreadTest.ExternalMessageLoop (which fails on patch set 10 and passes on 12+), PTAnL. Thanks! Gab ...
4 years, 4 months ago (2016-07-26 20:25:34 UTC) #57
gab
One last thing that just occurred to me : non-joinable base::Thread instances should never be ...
4 years, 4 months ago (2016-07-27 18:26:02 UTC) #62
danakj
On 2016/07/27 18:26:02, gab wrote: > One last thing that just occurred to me : ...
4 years, 4 months ago (2016-07-27 20:25:45 UTC) #63
gab
On 2016/07/27 20:25:45, danakj wrote: > On 2016/07/27 18:26:02, gab wrote: > > One last ...
4 years, 4 months ago (2016-07-28 14:58:07 UTC) #68
danakj
Why do you use an AtomicFlag here? The flag is only useful when you've joined, ...
4 years, 4 months ago (2016-07-28 19:07:40 UTC) #76
gab
On 2016/07/28 19:07:40, danakj wrote: > Why do you use an AtomicFlag here? The flag ...
4 years, 4 months ago (2016-07-28 21:40:15 UTC) #79
danakj
On Thu, Jul 28, 2016 at 2:40 PM, <gab@chromium.org> wrote: > On 2016/07/28 19:07:40, danakj ...
4 years, 4 months ago (2016-07-28 21:44:50 UTC) #80
gab
On 2016/07/28 21:44:50, danakj wrote: > On Thu, Jul 28, 2016 at 2:40 PM, <https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=gab@chromium.org> ...
4 years, 4 months ago (2016-07-28 23:35:25 UTC) #81
danakj
On Thu, Jul 28, 2016 at 4:35 PM, <gab@chromium.org> wrote: > On 2016/07/28 21:44:50, danakj ...
4 years, 4 months ago (2016-07-29 20:43:19 UTC) #86
gab
Ok, replaced AtomicFlag with |bool joinable_|, added checks for it (prevents Stop() from being called ...
4 years, 4 months ago (2016-08-01 15:04:31 UTC) #88
gab
On 2016/08/01 15:04:31, gab wrote: > Ok, replaced AtomicFlag with |bool joinable_|, added checks for ...
4 years, 4 months ago (2016-08-01 18:21:55 UTC) #90
Lei Zhang
On 2016/08/01 18:21:55, gab wrote: > On 2016/08/01 15:04:31, gab wrote: > > Ok, replaced ...
4 years, 4 months ago (2016-08-01 21:12:07 UTC) #101
gab
On 2016/08/01 21:12:07, Lei Zhang wrote: > On 2016/08/01 18:21:55, gab wrote: > > On ...
4 years, 4 months ago (2016-08-02 01:43:37 UTC) #102
gab
On 2016/08/02 01:43:37, gab wrote: > On 2016/08/01 21:12:07, Lei Zhang wrote: > > On ...
4 years, 4 months ago (2016-08-02 15:11:56 UTC) #105
gab
On 2016/08/02 15:11:56, gab wrote: > On 2016/08/02 01:43:37, gab wrote: > > On 2016/08/01 ...
4 years, 4 months ago (2016-08-02 21:28:05 UTC) #108
Lei Zhang
On 2016/08/02 21:28:05, gab wrote: > ping thestig, thanks! Busy/slow pong. I need a few ...
4 years, 4 months ago (2016-08-02 21:32:24 UTC) #109
gab
On 2016/08/02 21:32:24, Lei Zhang wrote: > On 2016/08/02 21:28:05, gab wrote: > > ping ...
4 years, 4 months ago (2016-08-02 21:53:30 UTC) #110
Lei Zhang
lgtm
4 years, 4 months ago (2016-08-03 16:33:35 UTC) #111
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/2135413003/620001
4 years, 4 months ago (2016-08-03 16:45:20 UTC) #114
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/230281)
4 years, 4 months ago (2016-08-03 16:52:14 UTC) #116
gab
TBR jam@ for naming side-effects on content/browser/browser_thread_impl.cc and its iOS twin (ios/web/web_thread_impl.cc)
4 years, 4 months ago (2016-08-03 17:24:54 UTC) #118
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/2135413003/620001
4 years, 4 months ago (2016-08-03 17:26:47 UTC) #121
jam
On 2016/08/03 17:24:54, gab wrote: > TBR jam@ for naming side-effects on content/browser/browser_thread_impl.cc and > ...
4 years, 4 months ago (2016-08-03 17:46:09 UTC) #122
commit-bot: I haz the power
Committed patchset #25 (id:620001)
4 years, 4 months ago (2016-08-03 19:44:07 UTC) #125
commit-bot: I haz the power
4 years, 4 months ago (2016-08-03 19:46:53 UTC) #127
Message was sent while issue was closed.
Patchset 25 (id:??) landed as
https://crrev.com/9a473d5bfb65cffcb6576496232f66023af79fdf
Cr-Commit-Position: refs/heads/master@{#409597}

Powered by Google App Engine
This is Rietveld 408576698