Timeout.Infinite 字段

定义

一个用于指定无限长等待时间的常数,适用于接受 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建议你使用其他类 ( Mutex例如、 MonitorEventWaitHandleSemaphore ) 来同步线程或管理资源。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).

适用于