語言

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。

備註

注意事項

不要使用 Suspend and Resume 方法來同步執行緒的活動。 當你暫停執行緒時,你無法知道執行緒正在執行什麼程式碼。 如果你在安全權限評估期間暫停執行緒,該執行緒仍持有鎖,其他執行緒 AppDomain 可能會被封鎖。 如果你在執行類別建構子時暫停執行緒,該執行緒中嘗試使用該類別的其他執行緒 AppDomain 就會被阻擋。 僵局很容易發生。

適用於

另請參閱