org.codehaus.gpars

groovyx.gpars.dataflow.impl
[Java] Class ResizeableCountDownLatch

java.lang.Object
  groovyx.gpars.dataflow.impl.ResizeableCountDownLatch

public final class ResizeableCountDownLatch

CountDownLatch with the ability to change the number of waiting parties

Authors:
Vaclav Pech
Doug Lea


Nested Class Summary
private static class ResizeableCountDownLatch.Sync

 
Field Summary
private ResizeableCountDownLatch.Sync sync

 
Constructor Summary
ResizeableCountDownLatch()

 
Method Summary
java.lang.Object ResizeableCountDownLatch(int count)

boolean attemptToCountDownAndAwait(long timeout)

void await()

boolean await(long timeout, java.util.concurrent.TimeUnit unit)

Attempts to atomically count down the latch and await release with a timeout.

void countDown()

void decreaseCount()

long getCount()

void increaseCount()

boolean isReleasedFlag()

java.lang.String toString()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

sync

private final ResizeableCountDownLatch.Sync sync


 
Constructor Detail

ResizeableCountDownLatch

ResizeableCountDownLatch()


 
Method Detail

ResizeableCountDownLatch

public java.lang.Object ResizeableCountDownLatch(int count)


attemptToCountDownAndAwait

public boolean attemptToCountDownAndAwait(long timeout)


await

public void await()


await

public boolean await(long timeout, java.util.concurrent.TimeUnit unit)
Attempts to atomically count down the latch and await release with a timeout. If the timeout expires, the count is increased and the latch is re-tested before reporting failed timeout.
throws:
InterruptedException If the thread gets interrupted while waiting for the release
Parameters:
timeout - The time in nanoseconds to await
Returns:
True, if successful, false, is the timeout elapses without the latch being released


countDown

public void countDown()


decreaseCount

public void decreaseCount()


getCount

public long getCount()


increaseCount

public void increaseCount()


isReleasedFlag

public boolean isReleasedFlag()


toString

public java.lang.String toString()


 

Copyright © 2008–2013 Václav Pech. All Rights Reserved.