summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-07-17 10:26:09 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-17 10:26:09 -0700
commit7405448c6c467d609b64e15f9c6fd19932bc9fde (patch)
tree6cbf4ac02bcde043d27c2d85aee0a48b83c6c5bf
parent61ecc585bd4d2ae64f6cb6cd4524a3292ff4f201 (diff)
parent6d69f592696f3bbd3bb0978ae3b25f2c359aac0d (diff)
downloadart-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.cc8
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_);
}