[libbluray-devel] GUIManager: use correct lock

hpi1 git at videolan.org
Sun Aug 21 12:37:22 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Aug 21 13:31:08 2016 +0300| [afd68f379d296efc12dd6a53006007f19f53c129] | committer: hpi1

GUIManager: use correct lock

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=afd68f379d296efc12dd6a53006007f19f53c129
---

 src/libbluray/bdj/java/org/videolan/GUIManager.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/GUIManager.java b/src/libbluray/bdj/java/org/videolan/GUIManager.java
index 27c2826..88a464b 100644
--- a/src/libbluray/bdj/java/org/videolan/GUIManager.java
+++ b/src/libbluray/bdj/java/org/videolan/GUIManager.java
@@ -44,12 +44,14 @@ public class GUIManager extends BDRootWindow {
         }
     }
 
-    public static synchronized GUIManager getInstance() {
-        if (instance == null) {
-            Logger.getLogger("GUIManager").error("getInstance(): no instance !");
-            throw new Error("no GUIManager instance");
+    public static GUIManager getInstance() {
+        synchronized (instanceLock) {
+            if (instance == null) {
+                Logger.getLogger("GUIManager").error("getInstance(): no instance !");
+                throw new Error("no GUIManager instance");
+            }
+            return instance;
         }
-        return instance;
     }
 
     public BufferedImage createBufferedImage(int width, int height)



More information about the libbluray-devel mailing list