Timeout.Infinite Timeout.Infinite Timeout.Infinite Timeout.Infinite Field

定義

用來為接受 Int32 參數之執行緒方法指定無限等候期間的常數。A constant used to specify an infinite waiting period, for threading methods that accept an Int32 parameter.

public: int Infinite = -1;
public const int Infinite = -1;
val mutable Infinite : int
Public Const Infinite As Integer  = -1

欄位值

備註

執行緒可接受的方法millisecondsTimeout參數,例如Thread.Sleep(Int32)Thread.Join(Int32),無限期地暫止這個執行緒會使用此值。For threading methods that accept a millisecondsTimeout parameter, such as Thread.Sleep(Int32) and Thread.Join(Int32), this value is used to suspend the thread indefinitely. 不過,在大部分情況下,我們建議使用其他System.Threading類別,例如MutexMonitorEventWaitHandle,或Semaphore相反地,若要同步處理執行緒或管理資源。However, in most cases, we recommend that you use other System.Threading classes, such as Mutex, Monitor, EventWaitHandle, or Semaphore instead, to synchronize threads or manage resources.

這個欄位的值為-1 (0xFFFFFFFF)。The value of this field is -1 (0xFFFFFFFF).

適用於