Thread.Resume 方法

定义

注意

Thread.Resume has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.

注意

Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. https://go.microsoft.com/fwlink/?linkid=14202

注意

Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202

恢复已挂起的线程。

public:
 void Resume();
[System.Obsolete("Thread.Resume has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")]
public void Resume();
[System.Obsolete("Thread.Resume has been deprecated.  Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.  https://go.microsoft.com/fwlink/?linkid=14202", false)]
public void Resume();
[System.Obsolete("Thread.Resume has been deprecated.  Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.  http://go.microsoft.com/fwlink/?linkid=14202", false)]
public void Resume();
public void Resume();
[<System.Obsolete("Thread.Resume has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")>]
member this.Resume : unit -> unit
[<System.Obsolete("Thread.Resume has been deprecated.  Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.  https://go.microsoft.com/fwlink/?linkid=14202", false)>]
member this.Resume : unit -> unit
[<System.Obsolete("Thread.Resume has been deprecated.  Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.  http://go.microsoft.com/fwlink/?linkid=14202", false)>]
member this.Resume : unit -> unit
member this.Resume : unit -> unit
Public Sub Resume ()
属性

例外

仅限 .NET Core 和 .NET 5+ :在所有情况下。

线程尚未启动、已终止或未处于挂起状态。

调用方没有相应的 SecurityPermission

注解

Caution

请勿使用 SuspendResume 方法同步线程的活动。 你无法知道挂起线程时正在执行的代码。 如果在安全权限评估期间暂停线程,则可能会阻止线程中的其他 AppDomain 线程。 如果在执行类构造函数时挂起线程,则尝试使用该类的其他线程 AppDomain 将被阻止。 死锁很容易发生。

适用于

另请参阅