[libbluray-devel] BDJThreadGroup: error out in waitForShutdown if waiting for current thread to terminate

hpi1 git at videolan.org
Sun May 4 16:52:26 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Apr 29 12:25:24 2014 +0300| [e5568d536f5caa44167274c42a19c0f1b37b69ae] | committer: hpi1

BDJThreadGroup: error out in waitForShutdown if waiting for current thread to terminate

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

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

diff --git a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
index b76a2e5..41f7aa6 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
@@ -52,6 +52,12 @@ public class BDJThreadGroup extends ThreadGroup {
     }
 
     public boolean waitForShutdown(int timeout, int maxThreads) {
+
+        if (parentOf(Thread.currentThread().getThreadGroup()) && maxThreads < 1) {
+            logger.error("Current Thread is contained within ThreadGroup to be disposed.");
+            throw new IllegalThreadStateException("Current Thread is contained within ThreadGroup to be disposed.");
+        }
+
         long startTime = System.currentTimeMillis();
         long endTime = startTime + timeout;
         while ((activeCount() > maxThreads) &&



More information about the libbluray-devel mailing list