RFR: 8253064: monitor list simplifications and getting rid of TSM [v6]
Daniel D.Daugherty
dcubed at openjdk.java.net
Wed Nov 11 15:09:04 UTC 2020
On Wed, 11 Nov 2020 04:50:52 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
>>
>> resolve more robehn and coleenp comments.
>
> src/hotspot/share/runtime/synchronizer.cpp line 153:
>
>> 151: if (self->is_Java_thread()) {
>> 152: // A JavaThread must check for a safepoint/handshake and honor it.
>> 153: ObjectSynchronizer::chk_for_block_req(self->as_Java_thread(), "unlinking",
>
> I won't disapprove but this is a case where refactoring is IMO worse than code duplication. Logging parameters should not be a part of this API IMO.
At this point, the refactoring has grown on me. I like the fact that
it reduces the "noise" in those three functions.
> src/hotspot/share/runtime/synchronizer.cpp line 1228:
>
>> 1226: os::naked_short_sleep(999); // sleep for almost 1 second
>> 1227: } else {
>> 1228: os::naked_short_sleep(999); // sleep for almost 1 second
>
> So this block can now just be:
>
>> if (self->is_Java_thread()) {
>> ThreadBlockInVM tbivm(self->as_Java_thread());
>> }
>> os::naked_short_sleep(999); // sleep for almost 1 second
As @robehn pointed out, I screwed up that change because
I lost the block over duration of the sleep. I've reverted that
change to the original.
-------------
PR: https://git.openjdk.java.net/jdk/pull/642
More information about the serviceability-dev
mailing list