Index: base/threading/thread.h |
diff --git a/base/threading/thread.h b/base/threading/thread.h |
index 5126491b3861cdb60f23eec1b40b11466d27a33a..929828bf49872c878eb3fa5716d17daf44132d3a 100644 |
--- a/base/threading/thread.h |
+++ b/base/threading/thread.h |
@@ -170,7 +170,7 @@ class BASE_EXPORT Thread : PlatformThread::Delegate { |
// The native thread handle. |
PlatformThreadHandle thread_handle() { return thread_; } |
- // The thread ID. |
+ // The thread ID. Only valid after this Thread was started. |
PlatformThreadId thread_id() const; |
// Returns true if the thread has been started, and not yet stopped. |
@@ -216,11 +216,15 @@ class BASE_EXPORT Thread : PlatformThread::Delegate { |
// True while inside of Run(). |
bool running_; |
- mutable base::Lock running_lock_; // Protects running_. |
+ mutable base::Lock running_lock_; // Protects |running_|. |
// The thread's handle. |
PlatformThreadHandle thread_; |
- mutable base::Lock thread_lock_; // Protects thread_. |
+ mutable base::Lock thread_lock_; // Protects |thread_|. |
+ |
+ // The thread's id once it was started. |
+ PlatformThreadId id_; |
+ mutable base::Lock id_lock_; // Protects |id_|. |
gab
2015/07/09 18:19:00
I'm not convinced there is enough contention to ju
Takashi Toyoshima
2015/07/14 10:47:28
Done.
gab
2015/07/16 17:28:24
To be clear, I didn't mean to say lock-less, just
|
// The thread's message loop. Valid only while the thread is alive. Set |
// by the created thread. |