Index: base/threading/sequenced_worker_pool.cc |
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc |
index 24a07511a9847a4faba4dc855470cbda3fbb347b..4a82b7b95cfb2c9471d2352170f945647d6c0417 100644 |
--- a/base/threading/sequenced_worker_pool.cc |
+++ b/base/threading/sequenced_worker_pool.cc |
@@ -246,6 +246,12 @@ class SequencedWorkerPool::Worker : public SimpleThread { |
is_processing_task_ = true; |
task_sequence_token_ = token; |
task_shutdown_behavior_ = shutdown_behavior; |
+ |
+ // It is dangerous for tasks with CONTINUE_ON_SHUTDOWN to access a class |
+ // that implements base::Singleton. This will trigger a DCHECK to warn of |
robliao
2016/04/25 23:03:30
Put why this is the case in the comment as well. (
manzagop (departed)
2016/04/26 13:13:44
Also mention leaky versions are fine to access fro
Patrick Monette
2016/04/26 19:05:27
Done.
Patrick Monette
2016/04/26 19:05:27
Done.
|
+ // such cases. See the comment about CONTINUE_ON_SHUTDOWN for more details. |
+ ThreadRestrictions::SetSingletonAllowed(task_shutdown_behavior_ != |
+ CONTINUE_ON_SHUTDOWN); |
} |
// Indicates that the task has finished running. |