Barrier.SignalAndWait Barrier.SignalAndWait Barrier.SignalAndWait Barrier.SignalAndWait Method

Definition

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well.

Overloads

SignalAndWait() SignalAndWait() SignalAndWait() SignalAndWait()

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well.

SignalAndWait(Int32) SignalAndWait(Int32) SignalAndWait(Int32) SignalAndWait(Int32)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a 32-bit signed integer to measure the timeout.

SignalAndWait(CancellationToken) SignalAndWait(CancellationToken) SignalAndWait(CancellationToken)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier, while observing a cancellation token.

SignalAndWait(TimeSpan) SignalAndWait(TimeSpan) SignalAndWait(TimeSpan) SignalAndWait(TimeSpan)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a TimeSpan object to measure the time interval.

SignalAndWait(Int32, CancellationToken) SignalAndWait(Int32, CancellationToken) SignalAndWait(Int32, CancellationToken)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a 32-bit signed integer to measure the timeout, while observing a cancellation token.

SignalAndWait(TimeSpan, CancellationToken) SignalAndWait(TimeSpan, CancellationToken) SignalAndWait(TimeSpan, CancellationToken)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a TimeSpan object to measure the time interval, while observing a cancellation token.

SignalAndWait() SignalAndWait() SignalAndWait() SignalAndWait()

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well.

public:
 void SignalAndWait();
public void SignalAndWait ();
member this.SignalAndWait : unit -> unit
Public Sub SignalAndWait ()

Exceptions

The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants.

If an exception is thrown from the post phase action of a Barrier after all participating threads have called SignalAndWait, the exception will be wrapped in a BarrierPostPhaseException and be thrown on all participating threads.

See Also

SignalAndWait(Int32) SignalAndWait(Int32) SignalAndWait(Int32) SignalAndWait(Int32)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a 32-bit signed integer to measure the timeout.

public:
 bool SignalAndWait(int millisecondsTimeout);
public bool SignalAndWait (int millisecondsTimeout);
member this.SignalAndWait : int -> bool
Public Function SignalAndWait (millisecondsTimeout As Integer) As Boolean

Parameters

millisecondsTimeout
Int32 Int32 Int32 Int32

The number of milliseconds to wait, or Infinite(-1) to wait indefinitely.

Returns

if all participants reached the barrier within the specified time; otherwise false.

Exceptions

millisecondsTimeout is a negative number other than -1, which represents an infinite time-out.

The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants.

If an exception is thrown from the post phase action of a Barrier after all participating threads have called SignalAndWait, the exception will be wrapped in a BarrierPostPhaseException and be thrown on all participating threads.

See Also

SignalAndWait(CancellationToken) SignalAndWait(CancellationToken) SignalAndWait(CancellationToken)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier, while observing a cancellation token.

public:
 void SignalAndWait(System::Threading::CancellationToken cancellationToken);
public void SignalAndWait (System.Threading.CancellationToken cancellationToken);
member this.SignalAndWait : System.Threading.CancellationToken -> unit

Parameters

Exceptions

The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants.

See Also

SignalAndWait(TimeSpan) SignalAndWait(TimeSpan) SignalAndWait(TimeSpan) SignalAndWait(TimeSpan)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a TimeSpan object to measure the time interval.

public:
 bool SignalAndWait(TimeSpan timeout);
public bool SignalAndWait (TimeSpan timeout);
member this.SignalAndWait : TimeSpan -> bool
Public Function SignalAndWait (timeout As TimeSpan) As Boolean

Parameters

timeout
TimeSpan TimeSpan TimeSpan TimeSpan

A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.

Returns

true if all other participants reached the barrier; otherwise, false.

Exceptions

timeout is a negative number other than -1 milliseconds, which represents an infinite time-out, or it is greater than 32,767.

The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants.

See Also

SignalAndWait(Int32, CancellationToken) SignalAndWait(Int32, CancellationToken) SignalAndWait(Int32, CancellationToken)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a 32-bit signed integer to measure the timeout, while observing a cancellation token.

public:
 bool SignalAndWait(int millisecondsTimeout, System::Threading::CancellationToken cancellationToken);
public bool SignalAndWait (int millisecondsTimeout, System.Threading.CancellationToken cancellationToken);
member this.SignalAndWait : int * System.Threading.CancellationToken -> bool

Parameters

millisecondsTimeout
Int32 Int32 Int32 Int32

The number of milliseconds to wait, or Infinite(-1) to wait indefinitely.

Returns

if all participants reached the barrier within the specified time; otherwise false

Exceptions

millisecondsTimeout is a negative number other than -1, which represents an infinite time-out.

The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants.

Remarks

If the cancellationToken was canceled before the signal took effect, then an OperationCanceledException is thrown and the ParticipantsRemaining value is not decreased. If the cancellationToken is not canceled or is canceled after the signal takes effect then ParticipantsRemaining is decreased and no OperationCanceledException is thrown.

See Also

SignalAndWait(TimeSpan, CancellationToken) SignalAndWait(TimeSpan, CancellationToken) SignalAndWait(TimeSpan, CancellationToken)

Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a TimeSpan object to measure the time interval, while observing a cancellation token.

public:
 bool SignalAndWait(TimeSpan timeout, System::Threading::CancellationToken cancellationToken);
public bool SignalAndWait (TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.SignalAndWait : TimeSpan * System.Threading.CancellationToken -> bool

Parameters

timeout
TimeSpan TimeSpan TimeSpan TimeSpan

A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.

Returns

true if all other participants reached the barrier; otherwise, false.

Exceptions

timeout is a negative number other than -1 milliseconds, which represents an infinite time-out.

The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants.

See Also

Applies to