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或EventWaitHandleSemaphore相反)来同步线程或管理资源。
此字段的值为 -00:00:00.0010000,或 -1 毫秒。