org.apache.avalon.excalibur.concurrent
Class ThreadBarrier

java.lang.Object
  |
  +--org.apache.avalon.excalibur.concurrent.ThreadBarrier

Deprecated. use EDU.oswego.cs.dl.util.concurrent.CyclicBarrier instead

public class ThreadBarrier
extends Object

A thread barrier blocks all threads hitting it until a pre-defined number of threads arrive at the barrier. This is useful for implementing release consistent concurrency where you don't want to take the performance penalty of providing mutual exclusion to shared resources

Since:
4.0
Version:
CVS $Revision: 1.5 $ $Date: 2003/04/05 19:39:33 $
Author:
Karthik Rangaraju

Constructor Summary
ThreadBarrier(int count)
          Deprecated. Initializes a thread barrier object with a given thread count.
 
Method Summary
 void barrierSynchronize()
          Deprecated. This method blocks all threads calling it until the threshold number of threads have called it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadBarrier

public ThreadBarrier(int count)
Deprecated. 
Initializes a thread barrier object with a given thread count.

Parameters:
count - is the number of threads that need to block on barrierSynchronize() before they will be allowed to pass through
See Also:
barrierSynchronize()
Method Detail

barrierSynchronize

public void barrierSynchronize()
                        throws InterruptedException
Deprecated. 
This method blocks all threads calling it until the threshold number of threads have called it. It then releases all threads blocked by it.

Throws:
InterruptedException - if any thread blocked during the call is interrupted


Copyright © 2000-2003 Apache Jakarta Project. All Rights Reserved.