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

Unified Diff: base/threading/thread.h

Issue 1207823004: PlatformThreadHandle: remove public id() interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review #14, #16 (upstream 1193303002 for review) Created 5 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/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.

Powered by Google App Engine
This is Rietveld 408576698