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.
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. |
The following table describes the icons displayed to the left of the object name.
Icon | Description |
---|---|
![]() |
The thread group that contains the current thread |
![]() |
A thread group that does not contain the current thread |
![]() |
The current thread |
![]() |
A thread that is running and is not current |
![]() |
A thread that is suspended and is not current |
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. |
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 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.