From 69d392114b82bc0831f61786d6bc49cddd906e84 Mon Sep 17 00:00:00 2001 From: louxiu Date: Sat, 28 Jul 2018 19:57:54 +0800 Subject: [PATCH] * Synchronize `Loader.loadLibrary()` to fix potential race condition (pull #246) --- src/main/java/org/bytedeco/javacpp/Loader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bytedeco/javacpp/Loader.java b/src/main/java/org/bytedeco/javacpp/Loader.java index 1e4745915..4b3f1dbdc 100644 --- a/src/main/java/org/bytedeco/javacpp/Loader.java +++ b/src/main/java/org/bytedeco/javacpp/Loader.java @@ -1119,7 +1119,7 @@ public static URL[] findLibrary(Class cls, ClassProperties properties, String li * (but {@code if (!isLoadLibraries) { return null; }}) * @throws UnsatisfiedLinkError on failure */ - public static String loadLibrary(URL[] urls, String libnameversion, String ... preloaded) { + public synchronized static String loadLibrary(URL[] urls, String libnameversion, String ... preloaded) { if (!isLoadLibraries()) { return null; }