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

Unified Diff: base/threading/sequenced_worker_pool.h

Issue 18650006: base: Make SequencedWorkerPool issue globally unique SequenceTokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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
Index: base/threading/sequenced_worker_pool.h
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index 7e04b071428c838dfcec0faa647f82baf2932045..52ca0c9eefed626d721f935a7bef6cec135590d5 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -143,6 +143,11 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
virtual void OnDestruct() = 0;
};
+ // Gets the SequencedToken of the current thread.
+ // If current thread is not a SequencedWorkerPool worker thread, this returns
+ // false and |result_token| is unmodified. |result_token| may not be NULL.
+ static bool CurrentThreadSequenceToken(SequenceToken* result_token);
akalin 2013/07/03 20:41:14 valid sequence tokens are non-zero. can you have t
tommycli 2013/07/03 21:04:02 This is kind of a messed-up point about SequencedW
akalin 2013/07/03 22:43:46 Hmm. Is there a need to distinguish the case where
tommycli 2013/07/03 23:23:12 Either way seems fine since they both require look
+
// When constructing a SequencedWorkerPool, there must be a
// MessageLoop on the current thread unless you plan to deliberately
// leak it.
@@ -159,7 +164,7 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
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
« base/base.gypi ('K') | « base/base.gypi ('k') | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698