[libbluray-devel] Give BDJActionQueue threads a name

hpi1 git at videolan.org
Mon Apr 14 11:43:42 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr 14 12:37:49 2014 +0300| [503793e234fed39c6c9a38062e376898cf84a128] | committer: hpi1

Give BDJActionQueue threads a name

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

 src/libbluray/bdj/java/org/videolan/BDJActionManager.java |    2 +-
 src/libbluray/bdj/java/org/videolan/BDJActionQueue.java   |    8 ++++----
 src/libbluray/bdj/java/org/videolan/BDJLoader.java        |    4 ++--
 src/libbluray/bdj/java/org/videolan/BDJXletContext.java   |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJActionManager.java b/src/libbluray/bdj/java/org/videolan/BDJActionManager.java
index 04b5343..4188f11 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJActionManager.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJActionManager.java
@@ -32,7 +32,7 @@ public class BDJActionManager {
     }
 
     public BDJActionManager() {
-        commandQueue = new BDJActionQueue();
+        commandQueue = new BDJActionQueue("BDJActionManager");
     }
 
     protected static void shutdown() {
diff --git a/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java b/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java
index 7e56e07..ee5850d 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java
@@ -21,13 +21,13 @@ package org.videolan;
 import java.util.LinkedList;
 
 class BDJActionQueue implements Runnable {
-    public BDJActionQueue() {
-        this(null);
+    public BDJActionQueue(String name) {
+        this(null, name);
     }
 
-    public BDJActionQueue(BDJThreadGroup threadGroup) {
+    public BDJActionQueue(BDJThreadGroup threadGroup, String name) {
         /* run all actions in given thread group / xlet context */
-        thread = new Thread(threadGroup, this);
+        thread = new Thread(threadGroup, this, name + ".BDJActionQueue");
         thread.setDaemon(true);
         thread.start();
     }
diff --git a/src/libbluray/bdj/java/org/videolan/BDJLoader.java b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
index 13aafaf..dfddcbb 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJLoader.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
@@ -71,7 +71,7 @@ public class BDJLoader {
             return false;
         synchronized (BDJLoader.class) {
             if (queue == null)
-                queue = new BDJActionQueue();
+                queue = new BDJActionQueue(null, "BDJLoader");
         }
         queue.put(new BDJLoaderAction(title, restart, callback));
         return true;
@@ -84,7 +84,7 @@ public class BDJLoader {
     public static boolean unload(BDJLoaderCallback callback) {
         synchronized (BDJLoader.class) {
             if (queue == null)
-                queue = new BDJActionQueue();
+                queue = new BDJActionQueue(null, "BDJLoader");
         }
         queue.put(new BDJLoaderAction(null, false, callback));
         return true;
diff --git a/src/libbluray/bdj/java/org/videolan/BDJXletContext.java b/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
index 31dbe28..d1208f6 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
@@ -53,7 +53,7 @@ public class BDJXletContext implements javax.tv.xlet.XletContext, javax.microedi
                                               entry.getInitialClass(),
                                               this);
 
-        callbackQueue = new BDJActionQueue(this.threadGroup);
+        callbackQueue = new BDJActionQueue(this.threadGroup, "CallbackQueue");
     }
 
     public Object getXletProperty(String key) {



More information about the libbluray-devel mailing list