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) { |