Merge "nativeloader: Add CloseNativeLibrary() method" into nyc-dev
am: acd3c71784
* commit 'acd3c71784d4207b478f411413f109281a83ef36':
nativeloader: Add CloseNativeLibrary() method
Change-Id: I109d4fd3b688720c5260a2b40641e25122085a5f
This commit is contained in:
commit
0d505c0645
|
@ -43,6 +43,9 @@ void* OpenNativeLibrary(JNIEnv* env,
|
|||
jobject class_loader,
|
||||
jstring library_path);
|
||||
|
||||
__attribute__((visibility("default")))
|
||||
bool CloseNativeLibrary(void* handle);
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
// Look up linker namespace by class_loader. Returns nullptr if
|
||||
// there is no namespace associated with the class_loader.
|
||||
|
|
|
@ -255,6 +255,10 @@ void* OpenNativeLibrary(JNIEnv* env,
|
|||
#endif
|
||||
}
|
||||
|
||||
bool CloseNativeLibrary(void* handle) {
|
||||
return dlclose(handle) == 0;
|
||||
}
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
android_namespace_t* FindNamespaceByClassLoader(JNIEnv* env, jobject class_loader) {
|
||||
std::lock_guard<std::mutex> guard(g_namespaces_mutex);
|
||||
|
|
Loading…
Reference in New Issue