[libbluray-devel] BDJAppProxy.stop(): add optional wait

hpi1 git at videolan.org
Sun Feb 21 18:10:52 CET 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Dec  4 12:34:47 2015 +0200| [973f25d4a667702b6bc0df445f9e7e7bb0d7d3bc] | committer: hpi1

BDJAppProxy.stop(): add optional wait

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

 src/libbluray/bdj/java/org/videolan/BDJAppProxy.java |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java b/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
index 72ba458..b5dfcf6 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
@@ -89,12 +89,21 @@ class BDJAppProxy implements DVBJProxy, Runnable {
         }
     }
 
-    public void stop(boolean force) {
+    public void stop(boolean force, int timeout) {
         AppCommand cmd = new AppCommand(AppCommand.CMD_STOP, new Boolean(force));
         synchronized(cmds) {
             cmds.addLast(cmd);
             cmds.notifyAll();
         }
+        if (timeout > 0) {
+            if (!cmd.waitDone(timeout)) {
+                logger.error("stop() timeout: Xlet " + context.getThreadGroup().getName());
+            }
+        }
+    }
+
+    public void stop(boolean force) {
+        stop(force, -1);
     }
 
     public void pause() {



More information about the libbluray-devel mailing list