org.ourgrid.test.threadServices
Class ExtendedThreadLists

java.lang.Object
  extended by org.ourgrid.test.threadServices.ThreadLists
      extended by org.ourgrid.test.threadServices.ExtendedThreadLists

public class ExtendedThreadLists
extends ThreadLists

Extends the threadlists to add the stillidle functionality.

Author:
Flavio Vinicius Diniz de Figueiredo - flaviov@lsd.ufcg.edu.br

Constructor Summary
ExtendedThreadLists()
           
 
Method Summary
 void includeInRunningThreads(java.lang.Thread t)
          Include in running threads a given thread.
 void includeInStartedThreads(java.lang.Thread t)
          Include in running threads a given thread.
protected  void removeFromWaitingThreads(java.lang.Thread t)
          Removes a certain thread from the list of waiting threads.
 boolean stillIdle()
          Verifies if no thread has waken up after waitUntilWorkIsDoneNotifying().
 void waitUntilWorkIsDoneNotifying()
          This method puts the current running thread to wait until all application running threads are waiting.
 
Methods inherited from class org.ourgrid.test.threadServices.ThreadLists
addWaiting, isThreadRunning, isThreadStarted, isThreadWaiting, notifyAllWaitingThreads, notifyOneWaitingThread, println, printRunningThreads, printStartedThreads, printWaitingThreads, removeRunnableThread, waitUntilAllThreadsDie, waitUntilThreadHasFinished, waitUntilThreadHasStartedRunning, waitUntilThreadIsWaiting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedThreadLists

public ExtendedThreadLists()
Method Detail

waitUntilWorkIsDoneNotifying

public void waitUntilWorkIsDoneNotifying()
Description copied from class: ThreadLists
This method puts the current running thread to wait until all application running threads are waiting.

Overrides:
waitUntilWorkIsDoneNotifying in class ThreadLists
See Also:
ThreadLists.waitUntilWorkIsDoneNotifying()

includeInRunningThreads

public void includeInRunningThreads(java.lang.Thread t)
Description copied from class: ThreadLists
Include in running threads a given thread.

Overrides:
includeInRunningThreads in class ThreadLists
Parameters:
t - The thread to be included.
See Also:
ThreadLists.includeInRunningThreads(java.lang.Thread)

includeInStartedThreads

public void includeInStartedThreads(java.lang.Thread t)
Description copied from class: ThreadLists
Include in running threads a given thread.

Overrides:
includeInStartedThreads in class ThreadLists
Parameters:
t - The thread to be included.
See Also:
ThreadLists.includeInStartedThreads(java.lang.Thread)

removeFromWaitingThreads

protected void removeFromWaitingThreads(java.lang.Thread t)
Description copied from class: ThreadLists
Removes a certain thread from the list of waiting threads.

Overrides:
removeFromWaitingThreads in class ThreadLists
Parameters:
t - The thread to be removed.
See Also:
ThreadLists.removeFromWaitingThreads(java.lang.Thread)

stillIdle

public boolean stillIdle()
Verifies if no thread has waken up after waitUntilWorkIsDoneNotifying().

Returns:
True if no thread has again started running.