public class PilotCommandProcessor
extends java.lang.Thread
Panzer.processPilotCommands
is performed by an uninvolved
thread, as to not execute external code in the same thread as the simulation.
The simulation thread has the task to control this thread, as
Pilot
code may likely result in nontermination.
Only use if you know what you're doing.
Correct procedure is as follows:
start()
.
isAlive
newJob()
with job parameters.
notify()
on this thread.
wait()
on this thread, using some timeout value.
If the caller is notified, the underlying Pilot terminated in time without
exception.
System.err
.
Modifier and Type | Field and Description |
---|---|
java.util.concurrent.locks.ReentrantLock |
lock |
Constructor and Description |
---|
PilotCommandProcessor() |
Modifier and Type | Method and Description |
---|---|
boolean |
isJobDone() |
void |
newJob(Body panzer,
double simulationTime,
java.lang.Thread controllerThread)
Only call if you know what you're doing.
|
void |
run()
Do not call this method directly!
Only use if you know what you're doing. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public boolean isJobDone()
public void newJob(Body panzer, double simulationTime, java.lang.Thread controllerThread)
panzer
- panzer to process pilot commands forsimulationTime
- should be strictly increasing at every call with
the same PanzerBody.processPilotCommands
,
PilotCommandProcessor
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
PilotCommandProcessor