Java.Util.Concurrent.CyclicBarrier.Await Method
Waits until all CyclicBarrier.Parties have invoked await on this barrier.

Syntax

[Android.Runtime.Register("await", "()I", "GetAwaitHandler")]
public virtual int Await ()

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.InterruptedExceptionif the current thread was interrupted while waiting
Java.Util.Concurrent.BrokenBarrierExceptionif another thread was interrupted or timed out while the current thread was waiting, or the barrier was reset, or the barrier was broken when await was called, or the barrier action (if present) failed due to an exception

Remarks

Waits until all CyclicBarrier.Parties have invoked await on this barrier.

If the current thread is not the last to arrive then it is disabled for thread scheduling purposes and lies dormant until one of the following things happens:

If the current thread:

then Java.Lang.InterruptedException is thrown and the current thread's interrupted status is cleared.

If the barrier is CyclicBarrier.Reset while any thread is waiting, or if the barrier CyclicBarrier.IsBroken when await is invoked, or while any thread is waiting, then Java.Util.Concurrent.BrokenBarrierException is thrown.

If any thread is Java.Lang.Thread.Interrupt while waiting, then all other waiting threads will throw Java.Util.Concurrent.BrokenBarrierException and the barrier is placed in the broken state.

If the current thread is the last thread to arrive, and a non-null barrier action was supplied in the constructor, then the current thread runs the action before allowing the other threads to continue. If an exception occurs during the barrier action then that exception will be propagated in the current thread and the barrier is placed in the broken state.

[Android Documentation]

Requirements

Namespace: Java.Util.Concurrent
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1