xtd 0.2.0
Loading...
Searching...
No Matches

◆ suspend()

void xtd::threading::thread::suspend ( )

Either suspends the thread, or if the thread is already suspended, has no effect (Should not be used).

Exceptions
xtd::threading::thread_state_exceptionThe thread has not been started or is dead.
Remarks
Works only on Windows operating syetm.
Warning
Do not use the xtd::threading::thread::suspend and xtd::threading::thread::resume methods to synchronize the activities of threads. You have no way of knowing what code a thread is executing when you suspend it. If you suspend a thread while it holds locks during a security permission evaluation, other threads in the application might be blocked. If you suspend a thread while it is executing a class constructor, other threads in the application that attempt to use that class are blocked. Deadlocks can occur very easily.