語言

Barrier 建構函式

定義

初始化 Barrier 類別的新執行個體。

多載

名稱 Description
Barrier(Int32)

初始化 Barrier 類別的新執行個體。

Barrier(Int32, Action<Barrier>)

初始化 Barrier 類別的新執行個體。

Barrier(Int32)

來源:
Barrier.cs
來源:
Barrier.cs
來源:
Barrier.cs
來源:
Barrier.cs
來源:
Barrier.cs

初始化 Barrier 類別的新執行個體。

public:
 Barrier(int participantCount);
public Barrier(int participantCount);
new System.Threading.Barrier : int -> System.Threading.Barrier
Public Sub New (participantCount As Integer)

參數

participantCount
Int32

參與討論串的數量。

例外狀況

participantCount 小於0或大於32,767。

另請參閱

適用於

Barrier(Int32, Action<Barrier>)

來源:
Barrier.cs
來源:
Barrier.cs
來源:
Barrier.cs
來源:
Barrier.cs
來源:
Barrier.cs

初始化 Barrier 類別的新執行個體。

public:
 Barrier(int participantCount, Action<System::Threading::Barrier ^> ^ postPhaseAction);
public Barrier(int participantCount, Action<System.Threading.Barrier> postPhaseAction);
public Barrier(int participantCount, Action<System.Threading.Barrier>? postPhaseAction);
new System.Threading.Barrier : int * Action<System.Threading.Barrier> -> System.Threading.Barrier
Public Sub New (participantCount As Integer, postPhaseAction As Action(Of Barrier))

參數

participantCount
Int32

參與討論串的數量。

postPhaseAction
Action<Barrier>

每個階段結束後執行的。Action<T> 可以傳遞 null(Visual Basic 中的 Nothing 表示未執行任何動作)。

例外狀況

participantCount 小於0或大於32,767。

備註

postPhaseAction代表將在所有參與者在某階段抵達障礙後被處決。 參與者在 postPhaseAction 代表完成執行前,不會被釋放進入下一階段。

另請參閱

適用於