public interface INormalThread
Instances provided by the API extend Thread
and do not take the inherited priority but instead set Thread.NORM_PRIORITY
and install an
Thread.UncaughtExceptionHandler
which simply logs any uncaught exceptions.
Example usage of INormalThread
:
INormalThread nt; // If your runnable needs the reference: must be instance attribute or else a reference wrapper nt = factory.newNormalThread( "Example", new Runnable() { public void run() { nt.checkedSleep( 500 ); System.out.println( "I am a NormalThread." ); } } ); // Start the normal thread: nt.start(); System.out.println( "I am not a NormalThread." ); // Wait for it to finish: nt.waitToFinish();
IFactory.newNormalThread(String, Runnable)
,
IControlledThread
Modifier and Type | Method and Description |
---|---|
java.lang.Thread |
asThread()
Casts this instance to
Thread . |
java.lang.InterruptedException |
checkedSleep(long ms)
Sleeps for the specified amount of milliseconds.
|
void |
start()
Starts the thread.
|
boolean |
waitToFinish()
Waits for this thread to finish.
|
java.lang.Thread asThread()
Thread
.this
as a Thread
boolean waitToFinish()
java.lang.InterruptedException checkedSleep(long ms)
ms
- milliseconds to sleepnull
otherwisevoid start()
Thread.start()
for details.Thread.start()
This API documentation is public and is intended for / allowed to be used by anyone.
Scelight home page: https://sites.google.com/site/scelight/
Scelight is a trademark of András Belicza. Copyright © András Belicza, 2013-2015. All rights reserved.