diff options
author | Chao-ying Fu <chao-ying.fu@intel.com> | 2014-05-21 11:20:52 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-05-22 10:25:57 -0700 |
commit | 9e36931cc79ca665908db9575126881d1cfdea5a (patch) | |
tree | 69099016576581e3e4d6c44ee01a7a6cc7db4b2c /runtime/thread_list.cc | |
parent | 5da6e2b88258733dd3856543af27ca73b395ef60 (diff) | |
download | art-9e36931cc79ca665908db9575126881d1cfdea5a.tar.gz art-9e36931cc79ca665908db9575126881d1cfdea5a.tar.bz2 art-9e36931cc79ca665908db9575126881d1cfdea5a.zip |
Move modify_ldt_lock into global lock order.
Mutex modify_ldt_lock was being removed during runtime shutdown while
daemons thread may still detach. Avoid this by placing in global lock
order.
This fixes cts dalvik vm-tests-tf that hang on some x86 devices.
By irogers: also, tidy global locks to agree with enum constants and
add extra verification that the global annotalysis order agrees with
the LockLevel order. Bumped the oat version and moved the locks as
LockLevel additions previously caused entrypoints to be moved. Make
unattached lock not handle the default mutex level case by moving the
allocated thread ids lock into the global order.
Change-Id: I9d03f19d44ea254accf0ceae8022563c77f7a02f
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
Diffstat (limited to 'runtime/thread_list.cc')
-rw-r--r-- | runtime/thread_list.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc index 8046500c59..388c9b4c76 100644 --- a/runtime/thread_list.cc +++ b/runtime/thread_list.cc @@ -40,8 +40,7 @@ namespace art { ThreadList::ThreadList() - : allocated_ids_lock_("allocated thread ids lock"), - suspend_all_count_(0), debug_suspend_all_count_(0), + : suspend_all_count_(0), debug_suspend_all_count_(0), thread_exit_cond_("thread exit condition variable", *Locks::thread_list_lock_) { CHECK(Monitor::IsValidLockWord(LockWord::FromThinLockId(kMaxThreadId, 1))); } @@ -849,7 +848,7 @@ void ThreadList::VerifyRoots(VerifyRootCallback* callback, void* arg) const { } uint32_t ThreadList::AllocThreadId(Thread* self) { - MutexLock mu(self, allocated_ids_lock_); + MutexLock mu(self, *Locks::allocated_thread_ids_lock_); for (size_t i = 0; i < allocated_ids_.size(); ++i) { if (!allocated_ids_[i]) { allocated_ids_.set(i); @@ -861,7 +860,7 @@ uint32_t ThreadList::AllocThreadId(Thread* self) { } void ThreadList::ReleaseThreadId(Thread* self, uint32_t id) { - MutexLock mu(self, allocated_ids_lock_); + MutexLock mu(self, *Locks::allocated_thread_ids_lock_); --id; // Zero is reserved to mean "invalid". DCHECK(allocated_ids_[id]) << id; allocated_ids_.reset(id); |