Timeout.InfiniteTimeSpan 欄位
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
一個常數,用來指定無限等待期,適用於接受參數 TimeSpan 的方法。
public: static initonly TimeSpan InfiniteTimeSpan;
public static readonly TimeSpan InfiniteTimeSpan;
[System.Runtime.InteropServices.ComVisible(false)]
public static readonly TimeSpan InfiniteTimeSpan;
staticval mutable InfiniteTimeSpan : TimeSpan
[<System.Runtime.InteropServices.ComVisible(false)>]
staticval mutable InfiniteTimeSpan : TimeSpan
Public Shared ReadOnly InfiniteTimeSpan As TimeSpan
欄位值
- 屬性
備註
對於接受 timeout 參數 TimeSpan為 的執行緒方法,例如 Thread.Sleep(TimeSpan) 和 Thread.Join(TimeSpan),此值用於無限懸掛執行緒。 然而,在大多數情況下,我們建議你使用其他 System.Threading 類別,例如 Mutex、 Monitor、 EventWaitHandle或 Semaphore ,來同步執行緒或管理資源。
此場的值為 -00:00:00.0010000,或 -1 毫秒。