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 类,如 MutexMonitorEventWaitHandleSemaphore,以同步线程或管理资源。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).

适用于