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

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: (rebase to show diff from 1193303002) 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..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.
- 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.
+ PlatformThreadId id_;
+
+ mutable base::Lock thread_lock_; // Protects |thread_| and |id_|.
// 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