Thread.ExternallySuspended
Specifies whether this thread is suspended.
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 its 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
![]() | Note When you reset this property to False, the call to set the property blocks if the execution is suspended. This prevents the step from executing further until the user continues the execution. |