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

Unified Diff: base/threading/sequenced_worker_pool.cc

Issue 994483005: Base: Fix another deadlock during shutdown of SequencedWorkerPool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/threading/sequenced_worker_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.cc
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 19b81b7b4b32a32d58bd74e2f8e237aa082f1722..b6c20337c05d6bbe02454643ca71b474c99e65d9 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -803,6 +803,18 @@ void SequencedWorkerPool::Inner::ThreadLoop(Worker* this_worker) {
delete_these_outside_lock.clear();
break;
}
+
+ // No work was found, but there are tasks that need deletion. The
+ // deletion must happen outside of the lock. Since the lock has been
brettw 2015/03/12 23:12:42 I don't follow this, maybe the comment needs to be
erikchen 2015/03/12 23:24:52 I broke the comment in two, moved the location of
+ // released, the current state about whether there is more work is no
+ // longer valid, and needs to be recalculated by jumping to the top of
+ // the loop.
+ if (delete_these_outside_lock.size()) {
+ AutoUnlock unlock(lock_);
+ delete_these_outside_lock.clear();
+ continue;
+ }
+
waiting_thread_count_++;
switch (status) {
« no previous file with comments | « no previous file | base/threading/sequenced_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698