Timeout.InfiniteTimeSpan 字段

定义

一个常量,用于为接受 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类(例如MutexMonitorEventWaitHandleSemaphore相反)来同步线程或管理资源。

此字段的值为 -00:00:00.0010000,或 -1 毫秒。

适用于