RFR: 8296089: Remove debug agent code for special handling of Thread.resume() [v3]

Alan Bateman alanb at openjdk.org
Fri Nov 11 07:03:31 UTC 2022


On Thu, 10 Nov 2022 20:58:36 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> 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.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add some comments for newly added asserts

This is good cleanup, I had forgotten that the JDWP agent has code to defend against direct use of Thread.resume. The changes look good. Somewhat subjective, but I think I would have made the comment in commonSuspendByNode just say that the error is not possible and not refer to behavior that was possible in the past.

-------------

Marked as reviewed by alanb (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10922


More information about the serviceability-dev mailing list