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
(cherry picked from commit 81c170fede9af9174aba71428334ac8f366a4b4f)
Change-Id: I15e50b699303a5c3739e4d19c153dd306e2ee504
diff --git a/runtime/thread_list.h b/runtime/thread_list.h
index f97ecd3..df81ad1 100644
--- a/runtime/thread_list.h
+++ b/runtime/thread_list.h
@@ -89,8 +89,8 @@
!Locks::thread_list_lock_,
!Locks::thread_suspend_count_lock_);
- // Find an already suspended thread (or self) by its id.
- Thread* FindThreadByThreadId(uint32_t thin_lock_id);
+ // Find an existing thread (or self) by its thread id (not tid).
+ Thread* FindThreadByThreadId(uint32_t thread_id) REQUIRES(Locks::thread_list_lock_);
// Run a checkpoint on threads, running threads are not suspended but run the checkpoint inside
// of the suspend check. Returns how many checkpoints that are expected to run, including for