Thread.Suspend 메서드

정의

주의

Thread.Suspend 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.Suspend has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.

주의

Thread.Suspend 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 Suspend();
[System.Obsolete("Thread.Suspend 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 Suspend ();
[System.Obsolete("Thread.Suspend has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")]
public void Suspend ();
public void Suspend ();
[System.Obsolete("Thread.Suspend 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 Suspend ();
[<System.Obsolete("Thread.Suspend 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.Suspend : unit -> unit
[<System.Obsolete("Thread.Suspend has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")>]
member this.Suspend : unit -> unit
member this.Suspend : unit -> unit
[<System.Obsolete("Thread.Suspend 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.Suspend : unit -> unit
Public Sub Suspend ()
특성

예외

.NET Core 및 .NET 5+ 전용: 모든 경우

스레드가 시작 또는 중단되지 않았습니다.

호출자에게 해당 SecurityPermission이 없습니다.

설명

스레드가 이미 일시 중단 된 경우이 메서드는 영향을 주지 않습니다.

주의

및 메서드를 사용 Suspend Resume 하 여 스레드 활동을 동기화 하지 마십시오. 스레드를 일시 중단할 때 스레드를 실행 하는 코드를 알 수 있는 방법이 없습니다. 보안 권한 평가 중에 잠금을 유지 하는 동안 스레드를 일시 중단 하는 경우의 다른 스레드가 AppDomain 차단 될 수 있습니다. 클래스 생성자를 실행 하는 동안 스레드를 일시 중단 하는 경우 해당 클래스를 AppDomain 사용 하려고 시도 하는의 다른 스레드가 차단 됩니다. 교착 상태는 매우 쉽게 발생할 수 있습니다.

스레드에서 메서드를 호출 하면 Suspend 시스템은 스레드 일시 중단이 요청 되었음을 메모 하 고 스레드를 실제로 일시 중단 하기 전에 안전한 지점에 도달할 때까지 스레드를 실행할 수 있습니다. 스레드의 안전 지점은 가비지 수집을 수행할 수 있는 실행 지점입니다. 안전 지점에 도달하면 런타임에서 일시 중단된 스레드가 관리 코드에서 더 이상 진행되지 않도록 보장합니다. 관리 코드 외부에서 실행하는 스레드는 가비지 수집에 대해 항상 안전하며 관리 코드의 실행을 다시 시작하려고 할 때까지 실행이 계속됩니다.

적용 대상

추가 정보