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

Unified Diff: base/threading/sequenced_worker_pool.h

Issue 10807045: Ensure SequencedWorkerPool::Shutdown() blocks for already-started SKIP_ON_SHUTDOWN tasks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fix Created 8 years, 5 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.h
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index e273d54882354b12d3ffa2130d054aeebbe8fe94..2befd19986433c4edcd519d20fe81e28287ba52f 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -62,7 +62,8 @@ class SequencedTaskRunner;
// from TaskRunner).
class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
public:
- // Defines what should happen to a task posted to the worker pool on shutdown.
+ // Defines what should happen to a task posted to the worker pool on
+ // shutdown.
enum WorkerShutdown {
// Tasks posted with this mode which have not run at shutdown will be
// deleted rather than run, and any tasks with this mode running at
@@ -82,14 +83,19 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
// example.
CONTINUE_ON_SHUTDOWN,
- // Tasks posted with this mode that have not started executing at shutdown
- // will be deleted rather than executed. However, tasks already in progress
- // will be completed.
+ // Tasks posted with this mode that have not started executing at
+ // shutdown will be deleted rather than executed. However, any tasks that
+ // have already begun executing when shutdown is called will be allowed
+ // to continue, and will block shutdown until completion.
+ //
+ // Note: Because Shutdown() may block while these tasks are executing,
+ // care must be taken to ensure that they do not block on the thread that
+ // called Shutdown(), as this may lead to deadlock.
SKIP_ON_SHUTDOWN,
- // Tasks posted with this mode will block browser shutdown until they're
- // executed. Since this can have significant performance implications, use
- // sparingly.
+ // Tasks posted with this mode will block shutdown until they're
+ // executed. Since this can have significant performance implications,
+ // use sparingly.
//
// Generally, this should be used only for user data, for example, a task
// writing a preference file.
« no previous file with comments | « no previous file | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698