summaryrefslogtreecommitdiffstats
path: root/runtime/thread.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2016-04-18 11:43:29 -0700
committerMathieu Chartier <mathieuc@google.com>2016-04-18 14:25:18 -0700
commit81c170fede9af9174aba71428334ac8f366a4b4f (patch)
treeea508c192bc79dbe76d41eb32959280794f73e37 /runtime/thread.h
parentad0b769e15eeb62963d543811a960deb6f309adf (diff)
downloadart-81c170fede9af9174aba71428334ac8f366a4b4f.tar.gz
art-81c170fede9af9174aba71428334ac8f366a4b4f.tar.bz2
art-81c170fede9af9174aba71428334ac8f366a4b4f.zip
Prevent holding stale Thread pointers
It is only really safe to hold non-self Thread* if you hold the thread list lock. Changed a few places to use thread ids instead of Thread. Bug: 28223501 Change-Id: Ie58bd755bf1dcf3c1f37da79ba0b2507f77574dd
Diffstat (limited to 'runtime/thread.h')
-rw-r--r--runtime/thread.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/thread.h b/runtime/thread.h
index b7b05919b0..922b4f76c3 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -312,6 +312,7 @@ class Thread {
*/
static int GetNativePriority();
+ // Guaranteed to be non-zero.
uint32_t GetThreadId() const {
return tls32_.thin_lock_thread_id;
}