Debugging: Threads Window

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 Debugger has the following thread states:

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 / Suspended

Thread is waiting. Object.wait() was called.

Zomibie

Thread has completed execution.

Icons

The Threads window displays the following thread icons:

Element Description

Current Thread Group icon.

The thread group that contains the current thread

Thread Group icon

A thread group that does not contain the current thread

Current Thread icon.

The current thread

Running Thread icon

A thread that is running and is not current

Suspended Thread icon.

A thread that is suspended and is not current

Actions

The Threads window has the following commands in the context menus:

Element 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 Option

Enables you to customize the display of the Threads window, including adding and removing columns of information, reordering the columns, and sorting the columns.

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 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 Suspended 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.


Related Topics

Developing Applications with NetBeans IDE,

Developing Applications with NetBeans IDE,

Developing Applications with NetBeans IDE,

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.