| Index: trunk/src/base/threading/sequenced_worker_pool.h
|
| ===================================================================
|
| --- trunk/src/base/threading/sequenced_worker_pool.h (revision 210433)
|
| +++ trunk/src/base/threading/sequenced_worker_pool.h (working copy)
|
| @@ -126,6 +126,11 @@
|
| return id_ == other.id_;
|
| }
|
|
|
| + // Returns false if current thread is executing an unsequenced task.
|
| + bool IsValid() const {
|
| + return id_ != 0;
|
| + }
|
| +
|
| private:
|
| friend class SequencedWorkerPool;
|
|
|
| @@ -143,6 +148,11 @@
|
| virtual void OnDestruct() = 0;
|
| };
|
|
|
| + // Gets the SequencedToken of the current thread.
|
| + // If current thread is not a SequencedWorkerPool worker thread or is running
|
| + // an unsequenced task, returns an invalid SequenceToken.
|
| + static SequenceToken GetSequenceTokenForCurrentThread();
|
| +
|
| // When constructing a SequencedWorkerPool, there must be a
|
| // MessageLoop on the current thread unless you plan to deliberately
|
| // leak it.
|
| @@ -159,7 +169,7 @@
|
| TestingObserver* observer);
|
|
|
| // 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
|
|
|