ManualResetEvent(Boolean) 建構函式

定義

使用布林值 (Boolean) 來初始化 ManualResetEvent 類別的新執行個體,指出初始狀態是否設定為信號狀態。

public:
 ManualResetEvent(bool initialState);
public ManualResetEvent (bool initialState);
new System.Threading.ManualResetEvent : bool -> System.Threading.ManualResetEvent
Public Sub New (initialState As Boolean)

參數

initialState
Boolean

如果初始狀態設定為信號狀態,為 true;初始狀態設定為非信號狀態則為 false

備註

如果 的初始狀態 ManualResetEvent (發出訊號,也就是說,如果透過傳遞 trueinitialState) 來建立,則等候 ManualResetEvent 的執行緒不會封鎖。 如果初始狀態為非簽署狀態,則執行緒會封鎖直到 Set 呼叫 方法為止。

適用於

另請參閱