# Suspending Execution of a Thread

You can suspend execution of any nonsystem thread. Once you suspend execution, you can view local (stack) and instance variables.

To suspend execution of a single thread:

1. Open the Threads/Stack window by choosing Debug -> Threads/Stack.
2. Select the thread you want to suspend by clicking on its name.
3. Click Suspend Thread.
   The glyph next to the thread changes to to indicate the thread is suspended.

To suspend execution of all nonsystem threads:

- Click Suspend All in the Threads/Stack window.

To resume execution from the exact point you left off, select a thread by clicking on its name, and then click Resume Thread.

Suspending a thread is not as precise as setting a breakpoint because you cannot control exactly where the thread is executing when you suspend it. Suspend a thread in cases where you can't set a breakpoint--for example, when your program encounters an infinite loop and you aren't sure where to set a breakpoint.

See also:

  Resuming Execution of a Thread
  Threads/Stack Overview