Thread.Suspend Method

Suspends the current thread or, if it is already suspended, has no effect.

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)

Syntax

[MethodImplAttribute]
public void Suspend ()

Remarks

Note that if the current thread is already suspended, this method has no effect whatsoever.

Note

CAUTION Do not use the Suspend and 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 is holding locks during a security permission evaluation, other threads in the AppDomain object might be blocked. If you suspend a thread while it is executing a class constructor, other threads in the AppDomain object that attempt to use that class will be blocked. In other words, using the Suspend and Resume methods to synchronize thread activities can very easily cause deadlocks, so you should avoid using them for this purpose.

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

Thread Class
Thread Members
System.Threading Namespace