Thread.ExternallySuspended
- Aktualisiert2025-07-21
- 1 Minute(n) Lesezeit
Thread.ExternallySuspended
Syntax
Thread.ExternallySuspended
Data Type
Purpose
Specifies to treat this thread as suspended when you stop the execution for a breakpoint.
Remarks
By default, when a step blocks or takes a long time to complete and the user attempts to suspend (break) execution, execution cannot suspend until the step unblocks and returns. For example, if the user breaks execution when a step launches a dialog box, execution does not suspend until after the user closes the dialog box.
A step uses this property to enable execution to break while it performs a lengthy operation or waits an indeterminate period of time. When a step sets this property, it specifies that TestStand considers the thread to be suspended if the user requests that the execution break. For example, you can add the following code to the step code module:
Boolean previousExternallySuspended = mySequenceContext.GetThread().ExternallySuspended
' set externally suspended to true mySequenceContext.GetThread().ExternallySuspended = true
' Insert code to launch a dialog box or perform another operation that might block indefinitely
' restore the previous setting of externally suspended mySequenceContext.GetThread().ExternallySuspended = previousExternallySuspended