Don't use dlopen on host for already loaded oat files.
Because the behavior of dlopen on the host is different then the
target in that case, and it causes tests to fail.
Bug: 28826195
Change-Id: Id202bbac3318bade89a4133a9bcb1ee01e8b6182
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h
index 3dca12a..3d7624d 100644
--- a/runtime/base/mutex.h
+++ b/runtime/base/mutex.h
@@ -83,7 +83,7 @@
kDexFileToMethodInlinerMapLock,
kInternTableLock,
kOatFileSecondaryLookupLock,
- kOatFileCountLock,
+ kHostDlOpenHandlesLock,
kOatFileManagerLock,
kTracingUniqueMethodsLock,
kTracingStreamingLock,
@@ -651,11 +651,11 @@
// Guards opened oat files in OatFileManager.
static ReaderWriterMutex* oat_file_manager_lock_ ACQUIRED_AFTER(modify_ldt_lock_);
- // Guards opened oat files in OatFileManager.
- static ReaderWriterMutex* oat_file_count_lock_ ACQUIRED_AFTER(oat_file_manager_lock_);
+ // Guards dlopen_handles_ in DlOpenOatFile.
+ static Mutex* host_dlopen_handles_lock_ ACQUIRED_AFTER(oat_file_manager_lock_);
// Guards intern table.
- static Mutex* intern_table_lock_ ACQUIRED_AFTER(oat_file_count_lock_);
+ static Mutex* intern_table_lock_ ACQUIRED_AFTER(host_dlopen_handles_lock_);
// Guards reference processor.
static Mutex* reference_processor_lock_ ACQUIRED_AFTER(intern_table_lock_);