Package org.jcsp.lang
Class ParThread
java.lang.Object
java.lang.Thread
org.jcsp.lang.ParThread
- All Implemented Interfaces:
Runnable
This is the Thread class used by
Parallel
to run all but
one of its given processes.
Description
A ParThread is a Thread used byParallel
to run
all but one of its given processes.
The CSProcess to be executed can be changed using the setProcess method providing the ParThread is not active.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Barrier
the barrier at the end of a PARprivate Barrier
parking barrier for this threadprivate CSProcess
the process to be executedprivate boolean
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Thread
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
-
Field Details
-
process
the process to be executed -
barrier
the barrier at the end of a PAR -
running
private boolean running -
park
parking barrier for this thread
-
-
Constructor Details
-
ParThread
Construct a new ParThread.- Parameters:
process
- the process to be executedbarrier
- the barrier for then end of the PAR
-
-
Method Details
-
reset
reset the ParThread.- Parameters:
process
- the process to be executedbarrier
- the barrier for then end of the PAR
-
terminate
public void terminate()Sets the ParThread to terminate next time it's unparked. -
release
public void release()Releases the ParThread to do some more work. -
run
public void run()The main body of this process. above.
-