Wrap native code loading part with synchornized block
This commit is contained in:
parent
c4870fb505
commit
75e34c8717
|
@ -112,7 +112,7 @@ public class SnappyLoader
|
||||||
return isLoaded;
|
return isLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SnappyNativeAPI load() {
|
static synchronized SnappyNativeAPI load() {
|
||||||
|
|
||||||
if (isInitialized)
|
if (isInitialized)
|
||||||
return api;
|
return api;
|
||||||
|
|
Binary file not shown.
|
@ -31,7 +31,7 @@ public class SnappyNativeLoader
|
||||||
private static HashMap<String, Boolean> loadedLibFiles = new HashMap<String, Boolean>();
|
private static HashMap<String, Boolean> loadedLibFiles = new HashMap<String, Boolean>();
|
||||||
private static HashMap<String, Boolean> loadedLib = new HashMap<String, Boolean>();
|
private static HashMap<String, Boolean> loadedLib = new HashMap<String, Boolean>();
|
||||||
|
|
||||||
public static void load(String lib) {
|
public static synchronized void load(String lib) {
|
||||||
if (loadedLibFiles.containsKey(lib) && loadedLibFiles.get(lib) == true)
|
if (loadedLibFiles.containsKey(lib) && loadedLibFiles.get(lib) == true)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class SnappyNativeLoader
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadLibrary(String libname) {
|
public static synchronized void loadLibrary(String libname) {
|
||||||
if (loadedLib.containsKey(libname) && loadedLib.get(libname) == true)
|
if (loadedLib.containsKey(libname) && loadedLib.get(libname) == true)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue