How it works...

As mentioned in the introduction of this recipe, by default, when you debug a concurrent Java application in Eclipse and the debug process finds a breakpoint, it only suspends the thread that hits the breakpoint first, but it allows other threads to continue with their execution. The following screenshot shows an example of this:

You can see that only worker-21 is suspended (marked in red in the screenshot), while the rest of the threads are running. However, while debugging a concurrent application, if you change Default suspend policy for new breakpoints to Suspend VM, all the threads will suspend their execution and the ...

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.