Метод | Описание | |
---|---|---|
AddParticipant ( ) : long |
Notifies the Barrier that there will be an additional participant.
|
|
AddParticipants ( int participantCount ) : long |
Notifies the Barrier that there will be additional participants.
|
|
Barrier ( int participantCount ) : System.Diagnostics |
Initializes a new instance of the Barrier class.
|
|
Barrier ( int participantCount, Action |
Initializes a new instance of the Barrier class. The postPhaseAction delegate will be executed after all participants have arrived at the barrier in one phase. The participants will not be released to the next phase until the postPhaseAction delegate has completed execution. |
|
Dispose ( ) : void |
Releases all resources used by the current instance of Barrier. Unlike most of the members of Barrier, Dispose is not thread-safe and may not be used concurrently with other members of this instance. |
|
RemoveParticipant ( ) : void |
Notifies the Barrier that there will be one less participant.
|
|
RemoveParticipants ( int participantCount ) : void |
Notifies the Barrier that there will be fewer participants.
|
|
SignalAndWait ( TimeSpan timeout ) : Boolean |
Signals that a participant has reached the Barrier and waits for all other participants to reach the barrier as well, using a T:System.TimeSpan to measure the time interval.
|
|
SignalAndWait ( TimeSpan timeout, |
Signals that a participant has reached the Barrier and waits for all other participants to reach the barrier as well, using a T:System.TimeSpan to measure the time interval, while observing a
|
|
SignalAndWait ( int millisecondsTimeout ) : bool |
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 time interval.
|
|
SignalAndWait ( int millisecondsTimeout, |
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 time interval, while observing a
|
|
SignalAndWait ( ) : void |
Signals that a participant has reached the Barrier and waits for all other participants to reach the barrier as well.
|
|
SignalAndWait ( |
Signals that a participant has reached the Barrier and waits for all other participants to reach the barrier, while observing a
|
Метод | Описание | |
---|---|---|
Dispose ( bool disposing ) : void |
When overridden in a derived class, releases the unmanaged resources used by the Barrier, and optionally releases the managed resources. Unlike most of the members of Barrier, Dispose is not thread-safe and may not be used concurrently with other members of this instance. |
Метод | Описание | |
---|---|---|
DiscontinuousWait ( |
The reason of discontinuous waiting instead of direct waiting on the event is to avoid the race where the sense is changed twice because the next phase is finished (due to either RemoveParticipant is called or another thread joined the next phase instead of the current thread) so the current thread will be stuck on the event because it is reset back The maxwait and the shift numbers are arbitrarily choosen, there were no references picking them
|
|
FinishPhase ( bool observedSense ) : void | ||
GetCurrentTotal ( int currentTotal, int ¤t, int &total, bool &sense ) : void |
Extract the three variables current, total and sense from a given big variable
|
|
InvokePostPhaseAction ( object obj ) : void | ||
SetCurrentTotal ( int currentTotal, int current, int total, bool sense ) : bool |
Write the three variables current. total and the sense to the m_currentTotal
|
|
SetResetEvents ( bool observedSense ) : void |
Sets the current phase event and reset the next phase event
|
|
ThrowIfDisposed ( ) : void |
Throw ObjectDisposedException if the barrier is disposed
|
|
WaitCurrentPhase ( |
Wait until the current phase finishes completely by spinning until either the event is set, or the phase count is incremented more than one time
|
public AddParticipants ( int participantCount ) : long | ||
participantCount | int | The number of additional participants to add to the /// barrier. |
Результат | long |
public Barrier ( int participantCount ) : System.Diagnostics | ||
participantCount | int | The number of participating threads. |
Результат | System.Diagnostics |
public Barrier ( int participantCount, Action |
||
participantCount | int | The number of participating threads. |
postPhaseAction | Action |
The |
Результат | System.Diagnostics |
protected Dispose ( bool disposing ) : void | ||
disposing | bool | true to release both managed and unmanaged resources; false to release /// only unmanaged resources. |
Результат | void |
public RemoveParticipants ( int participantCount ) : void | ||
participantCount | int | The number of additional participants to remove from the barrier. |
Результат | void |
public SignalAndWait ( TimeSpan timeout ) : Boolean | ||
timeout | TimeSpan | A |
Результат | Boolean |
public SignalAndWait ( TimeSpan timeout, |
||
timeout | TimeSpan | A |
cancellationToken | The |
|
Результат | Boolean |
public SignalAndWait ( int millisecondsTimeout ) : bool | ||
millisecondsTimeout | int | The number of milliseconds to wait, or |
Результат | bool |
public SignalAndWait ( int millisecondsTimeout, |
||
millisecondsTimeout | int | The number of milliseconds to wait, or |
cancellationToken | The |
|
Результат | bool |
public SignalAndWait ( |
||
cancellationToken | The |
|
Результат | void |