org.jcsp.nxt.lang
Class ParThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.jcsp.nxt.lang.ParThread
All Implemented Interfaces:
java.lang.Runnable

 class ParThread
extends java.lang.Thread

This is the Thread class used by Parallel to run all but one of its given processes.

Description

A ParThread is a Thread used by Parallel 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.

Author:
P.D.Austin, P.H.Welch, Alex Panayotopoulos
See Also:
, org.jcsp.lang.Parallel

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ParThread(CSProcess process, Barrier barrier)
          Construct a new ParThread.
 
Method Summary
 void release()
          Releases the ParThread to do some more work.
 void reset(CSProcess process, Barrier barrier)
          reset the ParThread.
 void run()
          The main body of this process.
 void terminate()
          Sets the ParThread to terminate next time it's unparked.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParThread

public ParThread(CSProcess process,
                 Barrier barrier)
Construct a new ParThread.

Parameters:
process - the process to be executed
barrier - the barrier for then end of the PAR
Method Detail

reset

public void reset(CSProcess process,
                  Barrier barrier)
reset the ParThread.

Parameters:
process - the process to be executed
barrier - 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.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread