Chromium Code Reviews| Index: base/threading/thread.h |
| diff --git a/base/threading/thread.h b/base/threading/thread.h |
| index 5126491b3861cdb60f23eec1b40b11466d27a33a..cc62abf284769ff74c47f445a4bb87d072f09864 100644 |
| --- a/base/threading/thread.h |
| +++ b/base/threading/thread.h |
| @@ -171,7 +171,7 @@ class BASE_EXPORT Thread : PlatformThread::Delegate { |
| PlatformThreadHandle thread_handle() { return thread_; } |
| // The thread ID. |
|
gab
2015/07/02 12:00:52
// The thread ID. Only valid after this Thread was
Takashi Toyoshima
2015/07/03 04:22:56
Ah, that's the thing I should explain here.
By the
gab
2015/07/08 18:35:20
"Started" SGTM.
|
| - PlatformThreadId thread_id() const; |
| + PlatformThreadId thread_id() const { return id_; } |
| // Returns true if the thread has been started, and not yet stopped. |
| bool IsRunning() const; |
| @@ -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_. |
| + |
| + // The thread's id. |
|
gab
2015/07/02 12:00:52
// The thread's id once it was started.
Takashi Toyoshima
2015/07/03 04:22:56
Done.
|
| + PlatformThreadId id_; |
| + |
| + mutable base::Lock thread_lock_; // Protects |thread_| and |id_|. |
|
Takashi Toyoshima
2015/07/03 04:22:56
Oops, I only updated the comment, but did nothing
|
| // The thread's message loop. Valid only while the thread is alive. Set |
| // by the created thread. |