[libinline-java-perl] 251/398: ok

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:43:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit 4272600c9d5a0efc7a14024647d9da6f77d231ca
Author: patrick_leb <>
Date:   Sun Nov 23 20:23:16 2003 +0000

    ok
---
 Java/sources/InlineJavaCallbackQueue.java | 66 +++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/Java/sources/InlineJavaCallbackQueue.java b/Java/sources/InlineJavaCallbackQueue.java
new file mode 100644
index 0000000..10695f5
--- /dev/null
+++ b/Java/sources/InlineJavaCallbackQueue.java
@@ -0,0 +1,66 @@
+package org.perl.inline.java ;
+
+import java.util.* ;
+import java.io.* ;
+
+
+/*
+	Queue for callbacks to Perl...
+*/
+class InlineJavaCallbackQueue {
+	// private InlineJavaServer ijs = InlineJavaServer.GetInstance() ;
+	private ArrayList queue = new ArrayList() ;
+	private boolean stop_loop = false ;
+
+
+	InlineJavaCallbackQueue() {
+	}
+
+
+	synchronized void EnqueueCallback(InlineJavaCallback ijc) {
+		queue.add(ijc) ;
+		notify() ;
+	}
+
+
+	synchronized private InlineJavaCallback DequeueCallback() {
+		if (queue.size() > 0){
+			return (InlineJavaCallback)queue.remove(0) ;
+		}
+		return null ;
+	}
+
+
+	synchronized InlineJavaCallback WaitForCallback(){
+		while (IsEmpty()){
+			try {
+				wait() ;
+			}
+			catch (InterruptedException ie){
+				// Do nothing, return and wait() some more...
+			}
+		}
+		return DequeueCallback() ;
+	}
+
+
+	private boolean IsEmpty(){
+		return (queue.size() == 0) ;
+	}
+
+
+	void StartLoop(){
+		stop_loop = false ;
+	}
+
+
+	synchronized void StopLoop(){
+		stop_loop = true ;
+		notify() ;
+	}
+
+
+	boolean IsLoopStopped(){
+		return stop_loop ;
+	}
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list