How it works...

While debugging a concurrent application using NetBeans, when the debugger hits a breakpoint, it suspends the thread that hit the breakpoint and shows the Debugging window in the top left-hand side corner with the threads that are currently running. You can use the window to pause or resume the threads that are currently running, using the Pause or Resume options. You can also see the values of the variables or attributes of the threads using the Variables tab.

NetBeans also includes a deadlock detector. When you select the Check for Deadlock option in the Debug menu, NetBeans performs an analysis of the application that you're debugging to determine whether there's a deadlock situation. This example presents a clear deadlock. ...

Get Java 9 Concurrency Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.