commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot Hale" <>
Subject ThreadPool Contribution
Date Mon, 15 Mar 2004 23:44:27 GMT

I have been using the Sandbox ThreadPool library, and have been finding it 
quite useful.  I did make a change to the MTQueue.remove() though.  If you 
are interested this is what I changed :


This way the MTQueue will just wait until something is added to the queue, 
instead of looping every 10 seconds until something is added to the queue.  
the MTQueue.add adequately notifies this Thread and returns null.
     * Removes the first object from the queue.
     * If the Queue is empty, it will wait() until another
     * Runnable is added to the queue.
    public synchronized Object remove(){
            return list.removeFirst();
        }catch (NoSuchElementException e){
            try {
            catch (InterruptedException e1) {
        return null;

Scot Hale

Get a FREE online computer virus scan from McAfee when you click here.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message