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 483b0957a06aa5d51b7b0d37e52afab1aa2243ca
Author: Patrick LeBoutillier <p...@cpan.org>
Date:   Thu Nov 1 17:13:31 2001 +0000

    Initial revision
---
 t/shared_jvm_test.pl | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/t/shared_jvm_test.pl b/t/shared_jvm_test.pl
new file mode 100644
index 0000000..9124ed0
--- /dev/null
+++ b/t/shared_jvm_test.pl
@@ -0,0 +1,78 @@
+use strict ;
+
+use blib ;
+
+
+BEGIN {
+       mkdir('./_Inline_test', 0777) unless -e './_Inline_test';
+}
+
+
+use Inline Config => 
+           DIRECTORY => './_Inline_test' ;
+
+
+use Inline(
+       Java => 'DATA',
+       SHARED_JVM => 1,
+) ;
+
+
+$t::i = 0 ;
+
+my $nb = 10 ;
+my $sum = (($nb) * ($nb + 1)) / 2 ;
+for (my $i = 0 ; $i < $nb ; $i++){
+       if (! fork()){
+               print STDERR "." ;
+               do_child($i) ;
+       }
+}
+
+
+# Wait for kids to finish
+for (my $i = 0 ; $i < 5 ; $i++){
+       sleep(1) ;
+       print STDERR "." ;
+}
+print STDERR "\n" ;
+
+if ($t::i == $sum){
+       print STDERR "Test succeeded\n" ;
+}
+else{
+       print STDERR "Test failed\n" ;
+}
+
+
+sub do_child {
+       my $i = shift ;
+
+       Inline::Java::reconnect_JVM() ;
+
+       my $t = new t() ;
+       my $j = 0 ;
+       for ( ; $j <= $i ; $j++){
+               $t->incr_i() ;
+       }
+       exit ;
+}
+
+
+__END__
+
+__Java__
+
+
+import java.util.* ;
+
+class t {
+       static public int i = 0 ;
+
+       public t(){
+       }
+
+       public void incr_i(){
+               i++ ;
+       }
+}

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

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to