[libinline-java-perl] 42/398: *** empty log message ***

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:42:42 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 dde30ef0044d7d6260eb48843e4654f53deb0eee
Author: patrick <>
Date:   Tue Mar 20 17:56:50 2001 +0000

    *** empty log message ***
---
 Java.pm          | 25 ++++++++++++++++++-------
 Java/Protocol.pm |  6 +++++-
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/Java.pm b/Java.pm
index de07f09..5e92ab3 100644
--- a/Java.pm
+++ b/Java.pm
@@ -60,13 +60,6 @@ sub done {
 
 	$DONE = 1 ;
 
-	# Close the sockets
-	# I tried to be polite, but it seems to be causing more harm
-	# than gain....
-	# foreach my $o (values %{$Inline::Java::INLINE}){
-	# 	close($o->{Java}->{socket}) ;
-	# }
-
 	my $ec = 0 ;
 	if (! $signal){
 		debug("killed by natural death.") ;
@@ -76,23 +69,41 @@ sub done {
 		$ec = 1 ;
 	}
 
+	# Ask the children to die and close the sockets
+	foreach my $o (values %{$Inline::Java::INLINE}){
+		my $sock = $o->{Java}->{socket} ;
+		# this asks the Java server to stop and die.
+		print $sock "die\n" ;
+		close($o->{Java}->{socket}) ;
+	}
+
 	foreach my $pid (@CHILDREN){
 		my $ok = kill 9, $pid ;
 		debug("killing $pid...", ($ok ? "ok" : "failed")) ;
 	}
 
 	debug("exiting with $ec") ;
+
+	# In Windows, it is possible that the process will hang here if
+	# the children are not all dead. But they should be. Really.
 	exit($ec) ;
 }
+
+
 END {
 	if (! $DONE){
 		done() ;
 	}
 }
+
+
 use sigtrap 'handler', \&done, 'normal-signals' ;
 
 
 
+######################## Inline interface ########################
+
+
 
 # Register this module as an Inline language support module
 sub register {
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 4207309..d3584d8 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -244,7 +244,7 @@ class InlineJavaProtocol {
 		if (c.equals("call_static_method")){
 			CallStaticJavaMethod(st) ;
 		}		
-		if (c.equals("call_method")){
+		else if (c.equals("call_method")){
 			CallJavaMethod(st) ;
 		}		
 		else if (c.equals("create_object")){
@@ -253,6 +253,10 @@ class InlineJavaProtocol {
 		else if (c.equals("delete_object")){
 			DeleteJavaObject(st) ;
 		}
+		else if (c.equals("die")){
+			ijs.debug(" received a request to die...") ;
+			System.exit(0) ;
+		}		
 	}
 
 

-- 
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