diff options
author | Brian Carlstrom <bdc@google.com> | 2013-07-17 10:26:09 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-07-17 10:26:09 -0700 |
commit | 7405448c6c467d609b64e15f9c6fd19932bc9fde (patch) | |
tree | 6cbf4ac02bcde043d27c2d85aee0a48b83c6c5bf | |
parent | 61ecc585bd4d2ae64f6cb6cd4524a3292ff4f201 (diff) | |
parent | 6d69f592696f3bbd3bb0978ae3b25f2c359aac0d (diff) | |
download | art-7405448c6c467d609b64e15f9c6fd19932bc9fde.zip art-7405448c6c467d609b64e15f9c6fd19932bc9fde.tar.gz art-7405448c6c467d609b64e15f9c6fd19932bc9fde.tar.bz2 |
am 6d69f592: Fix thread initialization issue when runtime started twice (as seen in image_test)
* commit '6d69f592696f3bbd3bb0978ae3b25f2c359aac0d':
Fix thread initialization issue when runtime started twice (as seen in image_test)
-rw-r--r-- | runtime/thread.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index 645c12c..56c5960 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -884,7 +884,13 @@ void Thread::Startup() { CHECK(!is_started_); is_started_ = true; { - MutexLock mu(Thread::Current(), *Locks::thread_suspend_count_lock_); // Keep GCC happy. + // MutexLock to keep annotalysis happy. + // + // Note we use NULL for the thread because Thread::Current can + // return garbage since (is_started_ == true) and + // Thread::pthread_key_self_ is not yet initialized. + // This was seen on glibc. + MutexLock mu(NULL, *Locks::thread_suspend_count_lock_); resume_cond_ = new ConditionVariable("Thread resumption condition variable", *Locks::thread_suspend_count_lock_); } |