threads
Create a new thread that will execute functionToRun.
Note: Any calls into Strange Eons from the background
thread must be made on the event dispatch thread.
(Use Thread.invokeLater() or Thread.invokeAndWait().)
Starts executing functionToRun in parallel with the
caller.
This is true if the thread has been started but has
not yet finished.
true if the thread is running
Sets the thread's interruption flag.
interrupted. Checking this value clears it to false until the
next time the thread is interrupted.
This is true if the currently running thread has been
interrupted. Checking this value clears it to false until the
next time the thread is interrupted.
Causes the current thread to wait until this thread ends. If the optional
msTimeout is given, the current thread will stop waiting after
that many milliseconds.
| msTimeout | the maximum time to wait, in ms (default is to wait forever) |
returns the value returned by the Thread's functionToRun, if the function returns a value and the
thread ended before the timeout elapsed
This is true if this thread has completed normally. If the
thread has not been started, is still alive, or ends with an exception,
then it returns false. Not that this property does not
indicate whether the function actually returned anything, only that
if it did, it is now available to be read.
If the thread has been started and the thread's functionToRun
has finished executing without throwing an uncaught exception, then
this property will store the value returned by the function, if any.
Runs a lengthy task in the background while providing feedback to the user.
| task | a function to be run in the background |
| message | a description of the task being performed |
Starts a new thread.
This is a convenience that creates a new Thread
and immediately start()s it. The new Thread
is returned.
returns the new Thread
Run a task on the event dispatch thread without waiting for it to return.
For example:
Thread.invokeLater(
function() {
println( "I will be called later." );
}
);
println( "I will be called now." );
Run a task on the event dispatch thread, waiting for it to return.
If the current thread is the event dispatch thread, then it will
run immediately. Otherwise, the current thread will be paused
until the event dispatch thread is able to execute the function.
Returns the result returned by functionToRun,
or undefined if the task throws an exception
This is a convenient reference to the class
java.util.concurrent.locks.ReentrantLock that can be used for synchronization purposes.
Index Contents