Debugging: Threads Window

See Also

The Threads window lists all threads in the current debugging session. You open the Threads window by choosing Window > Debugging > Threads.

The information given for each thread is the thread name, state and if the thread is suspended. One thread is the current thread. By default, the current thread is the thread in the current session from which the debugger gained control. When you select a different current session, the Threads window is updated to show the threads for that session.

Thread States

The following table describes the thread states for the debugger.

State Description
Monitor Thread is waiting on a Java monitor.
Not Started Thread has not yet been started.
Running Thread is runnable.
Sleeping Thread is sleeping. Thread.sleep() was called.
Unknown Thread status is unknown.
Wait Thread is waiting. Object.wait() was called.
Zombie Thread has completed execution.

Icons

The following table describes the icons displayed to the left of the object name.

Icon Description
Current thread group The thread group that contains the current thread
Thread group A thread group that does not contain the current thread
Current thread The current thread
Running thread A thread that is running and is not current
Suspended thread A thread that is suspended and is not current

Actions

Right-clicking the Threads window opens the pop-up menu, where you can choose the following actions:

Menu Item Description
Make Current Makes the selected thread the current thread. This command is equivalent to double-clicking the thread.
Resume Resumes execution of the selected thread.
Suspend Suspends execution of the selected thread.
Interrupt Interrupts execution of the selected thread.
Go to Source Shows the source code for the newest frame on the selected thread's stack.
List Options Enables you to customize the display of the Threads window, including adding and removing columns of information, reordering the columns, and sorting the columns. See Customizing a Debugger Window for more information.

Properties

By default, all thread properties are displayed directly in the Threads window, except for the Suspended property. To display the Suspended property in the Threads window, click the Change Column icon in the upper right corner of the window, or right-click in the window and choose List Options > Change Visible Columns and then select the Suspended checkbox in the dialog box.

If a thread is suspended (for example because a breakpoint was reached during the debugging session), the checkbox for that thread is selected in the Suspended column. Deselecting the Suspended checkbox causes the thread to resume.

See Also
Current Context in the Debugger
Debugging Threads in the IDE
Debugger Windows

Legal Notices