[libbluray-devel] BDJThreadGroup: make sure destroy() is not called if group has been already destroyed

hpi1 git at videolan.org
Wed Mar 23 11:56:52 CET 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Mar 23 12:18:13 2016 +0200| [2708e41e06bfc03199733faa4c5b133807d9336f] | committer: hpi1

BDJThreadGroup: make sure destroy() is not called if group has been already destroyed

Not fatal, but prevents incorrect alarms in log.

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

 src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
index 3b77846..905bb4a 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
@@ -85,8 +85,11 @@ class BDJThreadGroup extends ThreadGroup {
             waitForShutdown(500, 0);
         }
 
+        if (destroyed) return;
+
         try {
             destroy();
+            destroyed = true;
         } catch (IllegalThreadStateException e) {
             logger.error("ThreadGroup destroy failed: " + e);
         }
@@ -109,6 +112,7 @@ class BDJThreadGroup extends ThreadGroup {
         }
     }
 
+    private boolean destroyed = false;
     private final BDJXletContext context;
     private static final Logger logger = Logger.getLogger(BDJThreadGroup.class.getName());
 }



More information about the libbluray-devel mailing list