mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +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:
@@ -72,7 +72,7 @@ public class JavaInternal {
|
||||
|
||||
/**
|
||||
* Run the main task.
|
||||
* The maun task is executed by the thread pool so that when it blocks
|
||||
* The main task is executed by the thread pool so that when it blocks
|
||||
* the thread pool is notified correctly.
|
||||
*/
|
||||
public static void runMain(Runnable main)
|
||||
|
||||
@@ -9,7 +9,7 @@ package jmercury.runtime;
|
||||
/**
|
||||
* Interface to the Mercury Runtime System for Java code.
|
||||
*
|
||||
* No instance of this class is ever created, all it's members and methods
|
||||
* No instance of this class is ever created, all its members and methods
|
||||
* are static.
|
||||
*/
|
||||
public class MercuryRuntime
|
||||
@@ -40,7 +40,7 @@ public class MercuryRuntime
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive the exit status stored in the IO state.
|
||||
* Retrive the exit status stored in the I/O state.
|
||||
*/
|
||||
public static int getExitStatus() {
|
||||
return JavaInternal.exit_status;
|
||||
@@ -48,8 +48,8 @@ public class MercuryRuntime
|
||||
|
||||
/**
|
||||
* Finalise the runtime system.
|
||||
* This _must_ be cAlled at the normal end of any program. Currently
|
||||
* it runs finalisers and stops the thread pool.
|
||||
* This _must_ be called at the normal end of any program. It runs
|
||||
* finalisers and stops the thread pool.
|
||||
*/
|
||||
public static void finalise() {
|
||||
JavaInternal.run_finalisers();
|
||||
|
||||
@@ -453,7 +453,7 @@ public class MercuryThreadPool
|
||||
|
||||
/**
|
||||
* Run the thread pool.
|
||||
* The calling thread is used to "run" the thread pool. It's main job
|
||||
* The calling thread is used to "run" the thread pool. Its main job
|
||||
* is to keep the correct number of worker threads alive. It does not
|
||||
* return until the thread pool is stopped (with a call to shutdown()).
|
||||
* run() is usually called by runMain(), and shutdown() is usually
|
||||
@@ -556,11 +556,11 @@ public class MercuryThreadPool
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the thread pool in it's own thread.
|
||||
* Start the thread pool in its own thread.
|
||||
* Normally the thread pool ie executed directly by the main thread.
|
||||
* However, when Mercury is used as a library by a native Java
|
||||
* application this is not true, and the thread pool runs in a thread of
|
||||
* it's own.
|
||||
* its own.
|
||||
*/
|
||||
public MercuryThread startup()
|
||||
{
|
||||
@@ -591,10 +591,10 @@ public class MercuryThreadPool
|
||||
* Request that the thread pool shutdown.
|
||||
* This method does not wait for the thread pool to shutdown, it's an
|
||||
* asychronous signal. The thread pool will shutdown if: shutdown() has
|
||||
* been called (implicitly when running as an application) and there are
|
||||
* no remaining tasks either queued or running (spawn_native tasks are
|
||||
* not included). The requirement that the process does not exit until
|
||||
* all tasks have finish is maintained by the JVM.
|
||||
* been called (implicitly when main/2 is written in Mercury) and there
|
||||
* are no remaining tasks either queued or running (spawn_native tasks
|
||||
* are not included). The requirement that the process does not exit
|
||||
* until all tasks have finish is maintained by the JVM.
|
||||
*/
|
||||
public boolean shutdown()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user