JDK-8296089 : Remove debug agent code for special handling of Thread.resume()
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-10-29
  • Updated: 2024-07-17
  • Resolved: 2022-11-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b24Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The debug agent sets a breakpoint in Thread.resume() so it can prevent the debugger from suspending threads while in the resume call:

             /*
              * Track the resuming thread by marking it as being within
              * a resume and by setting up for notification on
              * a frame pop or exception. We won't allow the debugger
              * to suspend threads while any thread is within a
              * call to resume. This (along with the block below)
              * ensures that when the debugger
              * suspends a thread it will remain suspended.
              */
             trackAppResume(resumer);

Now that Thread.resume() is unsupported and just throws UnsupportedOperationException, all debug agent code related to this support can be removed. It's at least a couple of hundred lines of code, and with a fair amount of confusing synchronization. It will be nice to see it go.

For removal, search for code that references "AppResume" (do a case insensitive search). That should catch everything. I believe it is all contained to threadControl.c
Comments
Changeset: 2f7dc5c4 Author: Chris Plummer <cjplummer@openjdk.org> Date: 2022-11-14 20:22:45 +0000 URL: https://git.openjdk.org/jdk/commit/2f7dc5c4cde32978c46d092d593c5c76df1edc18
14-11-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10922 Date: 2022-10-31 19:08:14 +0000
31-10-2022