de.netseeker.ejoe.concurrent
Class ThreadQueue

java.lang.Object
  extended byde.netseeker.ejoe.concurrent.ThreadQueue

final class ThreadQueue
extends java.lang.Object

Since:
0.3.0
Author:
netseeker aka Michael Manske

Constructor Summary
ThreadQueue()
           
 
Method Summary
 void add(java.lang.Runnable thread)
          adds a new object to the end of the queue.
 java.lang.Runnable remove()
          Removes the first object from the queue, blocking until one is available.
 int size()
          Returns the current number of object in the queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadQueue

public ThreadQueue()
Method Detail

size

public int size()
Returns the current number of object in the queue


add

public void add(java.lang.Runnable thread)
adds a new object to the end of the queue. At least one thread will be notified.


remove

public java.lang.Runnable remove()
Removes the first object from the queue, blocking until one is available. Note that this method will never return null and could block forever.



Copyright © 2005-2006 netseeker. All Rights Reserved.