diff options
Diffstat (limited to 'runtime/base/mutex.cc')
| -rw-r--r-- | runtime/base/mutex.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index 6665f95bba..ce452cbcf6 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -67,6 +67,7 @@ Mutex* Locks::unexpected_signal_lock_ = nullptr; Uninterruptible Roles::uninterruptible_; ReaderWriterMutex* Locks::jni_globals_lock_ = nullptr; Mutex* Locks::jni_weak_globals_lock_ = nullptr; +ReaderWriterMutex* Locks::dex_lock_ = nullptr; struct AllMutexData { // A guard for all_mutexes_ that's not a mutex (Mutexes must CAS to acquire and busy wait). @@ -961,6 +962,7 @@ void Locks::Init() { DCHECK(thread_suspend_count_lock_ != nullptr); DCHECK(trace_lock_ != nullptr); DCHECK(unexpected_signal_lock_ != nullptr); + DCHECK(dex_lock_ != nullptr); } else { // Create global locks in level order from highest lock level to lowest. LockLevel current_lock_level = kInstrumentEntrypointsLock; @@ -1039,6 +1041,10 @@ void Locks::Init() { modify_ldt_lock_ = new Mutex("modify_ldt lock", current_lock_level); } + UPDATE_CURRENT_LOCK_LEVEL(kDexLock); + DCHECK(dex_lock_ == nullptr); + dex_lock_ = new ReaderWriterMutex("ClassLinker dex lock", current_lock_level); + UPDATE_CURRENT_LOCK_LEVEL(kOatFileManagerLock); DCHECK(oat_file_manager_lock_ == nullptr); oat_file_manager_lock_ = new ReaderWriterMutex("OatFile manager lock", current_lock_level); |