[libbluray-devel] Log killed threads

hpi1 git at videolan.org
Tue Mar 11 14:55:52 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Mar 11 15:46:05 2014 +0200| [4f8d1a5b8cfb017368a166eebe44bda9616bb4b2] | committer: hpi1

Log killed threads

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

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

diff --git a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
index e814d29..550d443 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
@@ -27,6 +27,22 @@ public class BDJThreadGroup extends ThreadGroup {
         this.context = context;
     }
 
+    public void uncaughtException(Thread t, Throwable e) {
+
+        String stack = "";
+        StackTraceElement elems[] = e.getStackTrace();
+        if (e != null) {
+            for (int i = 0; i < elems.length; i++)
+                stack += "\n\t" + elems[i].toString();
+        }
+
+        if (e instanceof ThreadDeath) {
+            logger.error("Thread " + t + " killed" + stack);
+        } else {
+            logger.error("Unhandled exception in thread " + t + ": " + e + stack);
+        }
+    }
+
     public BDJXletContext getContext() {
         return context;
     }



More information about the libbluray-devel mailing list