Index: base/threading/sequenced_worker_pool.h |
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h |
index 9369fb7adea535ea262a41ffe3850f133eddcb97..5094d4a1017e759a18edcdc495c40c3074901a2e 100644 |
--- a/base/threading/sequenced_worker_pool.h |
+++ b/base/threading/sequenced_worker_pool.h |
@@ -45,7 +45,8 @@ class SequencedTaskRunner; |
// destruction will be visible to T2. |
// |
// Example: |
-// SequencedWorkerPool::SequenceToken token = pool.GetSequenceToken(); |
+// SequencedWorkerPool::SequenceToken token = |
+// SequencedWorkerPool::GetSequenceToken(); |
// pool.PostSequencedWorkerTask(token, SequencedWorkerPool::SKIP_ON_SHUTDOWN, |
// FROM_HERE, base::Bind(...)); |
// pool.PostSequencedWorkerTask(token, SequencedWorkerPool::SKIP_ON_SHUTDOWN, |
@@ -161,9 +162,12 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
// an unsequenced task, returns an invalid SequenceToken. |
static SequenceToken GetSequenceTokenForCurrentThread(); |
- // Returns the SequencedWorkerPool that owns this thread, or null if the |
- // current thread is not a SequencedWorkerPool worker thread. |
- static scoped_refptr<SequencedWorkerPool> GetWorkerPoolForCurrentThread(); |
+ // Gets a SequencedTaskRunner for the current thread. If the current thread is |
+ // running an unsequenced task, a new SequenceToken will be generated and set, |
+ // so that the returned SequencedTaskRunner is guaranteed to runs tasks after |
gab
2015/11/10 19:54:19
s/runs/run
Bernhard Bauer
2015/11/10 20:31:47
Done.
|
+ // the current task has finished running. |
+ static scoped_refptr<SequencedTaskRunner> |
+ GetSequencedTaskRunnerForCurrentThread(); |
// When constructing a SequencedWorkerPool, there must be a |
// ThreadTaskRunnerHandle on the current thread unless you plan to |
@@ -182,7 +186,7 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
// Returns a unique token that can be used to sequence tasks posted to |
// PostSequencedWorkerTask(). Valid tokens are always nonzero. |
- SequenceToken GetSequenceToken(); |
+ static SequenceToken GetSequenceToken(); |
// Returns the sequence token associated with the given name. Calling this |
// function multiple times with the same string will always produce the |