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

Unified Diff: base/threading/sequenced_worker_pool.cc

Issue 956583004: Base: Fix a deadlock during shutdown of SequencedWorkerPool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 89224f74aa4d7b5cafa4398e5b6d2a3c6121c5bb..19b81b7b4b32a32d58bd74e2f8e237aa082f1722 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -798,9 +798,11 @@ void SequencedWorkerPool::Inner::ThreadLoop(Worker* this_worker) {
// to run them. Also, there may be some tasks stuck behind running
// ones with the same sequence token, but additional threads won't
// help this case.
- if (shutdown_called_ &&
- blocking_shutdown_pending_task_count_ == 0)
+ if (shutdown_called_ && blocking_shutdown_pending_task_count_ == 0) {
+ AutoUnlock unlock(lock_);
+ delete_these_outside_lock.clear();
break;
+ }
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