mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-29 17:04:13 +02:00
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;
|
||||
}
|
||||
|
||||
static SnappyNativeAPI load() {
|
||||
static synchronized SnappyNativeAPI load() {
|
||||
|
||||
if (isInitialized)
|
||||
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> 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)
|
||||
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)
|
||||
return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user