[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:
Paul Bone
2014-12-16 12:45:37 +11:00
parent e4a0adf424
commit 8b48c420d7
6 changed files with 25 additions and 22 deletions

View File

@@ -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();