mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 08:14:31 +00:00
[java] Make changes following Julien's review of my recent patch
java/runtime/JavaInternal.java:
java/runtime/MercuryRuntime.java:
java/runtime/MercuryThreadPool.java:
samples/java_interface/standalone_java/JavaMain.java:
samples/java_interface/standalone_java/Makefile:
samples/java_interface/standalone_java/mercury_lib.m:
As above.
This commit is contained in:
@@ -25,14 +25,17 @@ public class JavaMain {
|
||||
try {
|
||||
runProgram(args);
|
||||
} finally {
|
||||
// When we have finished calling Mercury procedures then we need to
|
||||
// tell the Mercury Runtime that we've finished using it.
|
||||
// This invokes any finalisers specified using ':- finalise'
|
||||
// declarations in the set of Mercury libraries we are using. It
|
||||
// also tells the thread pool to shutdown, if the thread pool is not
|
||||
// runnuing then this does nothing.
|
||||
// When we have finished calling Mercury procedures then we need
|
||||
// to tell the Mercury Runtime that we've finished using it.
|
||||
// The static method finalise() in the MercuryRuntime class does
|
||||
// this.
|
||||
// this. This call is (currently) mandatory otherwise the JVM
|
||||
// may not exit cleanly, therefore it should be called in a
|
||||
// finally block as in this example.
|
||||
//`
|
||||
// This call will invoke any finalisers specified using
|
||||
// ':- finalise' declarations in the set of Mercury libraries we
|
||||
// are using. It also tells the thread pool to shutdown, if the
|
||||
// thread pool is not runnuing then this does nothing.
|
||||
//
|
||||
MercuryRuntime.finalise();
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ MER_JARS = $(MER_LIB_DIR)/mer_std.jar:$(MER_LIB_DIR)/mer_rt.jar
|
||||
.PHONY: all
|
||||
all: run
|
||||
|
||||
JavaMain.class: JavaMain.java libmercury_lib.jar
|
||||
JavaMain.class: JavaMain.java mercury_lib.jar
|
||||
$(JAVAC) JavaMain.java -cp $(MER_JARS):Mercury/classs -d .
|
||||
|
||||
libmercury_lib.jar: mercury_lib.m
|
||||
mercury_lib.jar: mercury_lib.m
|
||||
$(MMC) --grade $(GRADE) --make libmercury_lib
|
||||
|
||||
.PHONY: run
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
%
|
||||
:- func cube(int) = int.
|
||||
|
||||
% fibs(N) returns the Nth fibbonanci number using a parallelised naive
|
||||
% fibs(N) returns the Nth Fibonacci number using a parallelised naive
|
||||
% algorithm.
|
||||
%
|
||||
:- func fibs(int) = int.
|
||||
|
||||
Reference in New Issue
Block a user