ProcessThread.WaitReason Property

 

Gets the reason that the thread is waiting.

Namespace:   System.Diagnostics
Assembly:  System (in System.dll)

public ThreadWaitReason WaitReason { get; }

Property Value

Type: System.Diagnostics.ThreadWaitReason

A ThreadWaitReason representing the reason that the thread is in the wait state.

Exception Condition
InvalidOperationException

The thread is not in the wait state.

PlatformNotSupportedException

The platform is Windows 98 or Windows Millennium Edition.

NotSupportedException

The process is on a remote computer.

The WaitReason property is valid only when the ThreadState is Wait. Therefore, check the ThreadState value before you get the WaitReason property.

.NET Framework
Available since 1.1
Return to top
Show: