Barrier.AddParticipants(Int32) 方法

定義

通知 Barrier,表示還會有多個其他參與者。

public:
 long AddParticipants(int participantCount);
public long AddParticipants (int participantCount);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public long AddParticipants (int participantCount);
member this.AddParticipants : int -> int64
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
member this.AddParticipants : int -> int64
Public Function AddParticipants (participantCount As Integer) As Long

參數

participantCount
Int32

要加入至屏障的其他參與者數目。

傳回

新參與者將第一次參與其中的屏障階段編號。

屬性

例外狀況

目前的執行個體已經過處置。

participantCount 小於 0。

-或-

加入 participantCount 參與者會造成屏障的參與者計數超過 32,767。

此方法是從 post-phase 動作中叫用。

備註

如果屏障目前正在執行後續階段動作,則會封鎖此呼叫,直到後續階段動作完成,且屏障已移至下一個階段為止。

適用於

另請參閱