| Index: base/threading/sequenced_worker_pool.h
|
| ===================================================================
|
| --- base/threading/sequenced_worker_pool.h (revision 126348)
|
| +++ base/threading/sequenced_worker_pool.h (working copy)
|
| @@ -26,12 +26,15 @@
|
|
|
| template <class T> class DeleteHelper;
|
|
|
| +class SequencedTaskRunner;
|
| +
|
| // A worker thread pool that enforces ordering between sets of tasks. It also
|
| // allows you to specify what should happen to your tasks on shutdown.
|
| //
|
| // To enforce ordering, get a unique sequence token from the pool and post all
|
| // tasks you want to order with the token. All tasks with the same token are
|
| -// guaranteed to execute serially, though not necessarily on the same thread.
|
| +// guaranteed to execute serially (i.e. there is no execution overlap
|
| +// whatsoever), though not necessarily on the same thread.
|
| //
|
| // Example:
|
| // SequencedWorkerPool::SequenceToken token = pool.GetSequenceToken();
|
| @@ -132,7 +135,7 @@
|
| const std::string& thread_name_prefix);
|
|
|
| // Returns a unique token that can be used to sequence tasks posted to
|
| - // PostSequencedWorkerTask(). Valid tokens are alwys nonzero.
|
| + // PostSequencedWorkerTask(). Valid tokens are always nonzero.
|
| SequenceToken GetSequenceToken();
|
|
|
| // Returns the sequence token associated with the given name. Calling this
|
| @@ -141,6 +144,13 @@
|
| // will be created.
|
| SequenceToken GetNamedSequenceToken(const std::string& name);
|
|
|
| + // Returns a SequencedTaskRunner wrapper for this SequencedWorkerPool.
|
| + scoped_refptr<SequencedTaskRunner> GetSequencedTaskRunner();
|
| + scoped_refptr<SequencedTaskRunner> GetSequencedTaskRunner(
|
| + SequenceToken token);
|
| + scoped_refptr<SequencedTaskRunner> GetSequencedTaskRunner(
|
| + const std::string& token_name);
|
| +
|
| // Posts the given task for execution in the worker pool. Tasks posted with
|
| // this function will execute in an unspecified order on a background thread.
|
| // Returns true if the task was posted. If your tasks have ordering
|
|
|