summaryrefslogtreecommitdiff
path: root/runtime/base/locks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/base/locks.cc')
-rw-r--r--runtime/base/locks.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/base/locks.cc b/runtime/base/locks.cc
index 1cec44c27e..7404d0d4fc 100644
--- a/runtime/base/locks.cc
+++ b/runtime/base/locks.cc
@@ -76,6 +76,7 @@ ReaderWriterMutex* Locks::jni_globals_lock_ = nullptr;
Mutex* Locks::jni_weak_globals_lock_ = nullptr;
ReaderWriterMutex* Locks::dex_lock_ = nullptr;
Mutex* Locks::native_debug_interface_lock_ = nullptr;
+ReaderWriterMutex* Locks::jni_id_lock_ = nullptr;
std::vector<BaseMutex*> Locks::expected_mutexes_on_weak_ref_access_;
Atomic<const BaseMutex*> Locks::expected_mutexes_on_weak_ref_access_guard_;
@@ -157,6 +158,7 @@ void Locks::Init() {
DCHECK(user_code_suspension_lock_ != nullptr);
DCHECK(dex_lock_ != nullptr);
DCHECK(native_debug_interface_lock_ != nullptr);
+ DCHECK(jni_id_lock_ != nullptr);
DCHECK(runtime_thread_pool_lock_ != nullptr);
} else {
// Create global locks in level order from highest lock level to lowest.
@@ -317,6 +319,10 @@ void Locks::Init() {
DCHECK(native_debug_interface_lock_ == nullptr);
native_debug_interface_lock_ = new Mutex("Native debug interface lock", current_lock_level);
+ UPDATE_CURRENT_LOCK_LEVEL(kJniIdLock);
+ DCHECK(jni_id_lock_ == nullptr);
+ jni_id_lock_ = new ReaderWriterMutex("JNI id map lock", current_lock_level);
+
UPDATE_CURRENT_LOCK_LEVEL(kAbortLock);
DCHECK(abort_lock_ == nullptr);
abort_lock_ = new Mutex("abort lock", current_lock_level, true);