pt.runtime
Class WorkerThread

java.lang.Object
  extended by java.lang.Thread
      extended by pt.runtime.TaskThread
          extended by pt.runtime.WorkerThread
All Implemented Interfaces:
java.lang.Runnable

public class WorkerThread
extends TaskThread


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 pt.runtime.TaskThread
currentTaskStack, taskpool, threadID
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WorkerThread(int id, Taskpool taskpool)
           
 
Method Summary
 boolean executeAnotherTaskOrSleep()
          This method is called to tell the worker to execute ONE other task from the taskpool (if it finds one), otherwise it will sleep for the specified time delay returns true if it did execute another task..
 void run()
           
 
Methods inherited from class pt.runtime.TaskThread
currentExecutingTask, executeTask, getThreadID, getTP, getTP, setTP, setTP
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkerThread

public WorkerThread(int id,
                    Taskpool taskpool)
Method Detail

executeAnotherTaskOrSleep

public boolean executeAnotherTaskOrSleep()
This method is called to tell the worker to execute ONE other task from the taskpool (if it finds one), otherwise it will sleep for the specified time delay returns true if it did execute another task.. otherwise false if it ended up sleeping instead


run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread