RFR: 8366671: Refactor Thread::SpinAcquire and Thread::SpinRelease [v8]

Anton Artemov aartemov at openjdk.org
Fri Nov 21 09:25:31 UTC 2025


On Thu, 20 Nov 2025 20:01:09 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8366671: Addressed reviewers' comments.
>
> src/hotspot/share/runtime/objectMonitor.cpp line 2040:
> 
>> 2038: bool ObjectMonitor::notify_internal(JavaThread* current) {
>> 2039:   bool did_notify = false;
>> 2040:   {
> 
> I don't think this extra level of block scope is needed. The only thing outside the end of this
> extra scope is the `return did_notify`, which could just as well be inside. Your call...

Agree, removed.

> src/hotspot/share/utilities/spinCriticalSection.hpp line 43:
> 
>> 41: 
>> 42:   // Low-level leaf-lock primitives used to implement synchronization.
>> 43:   // Not for general synchronization use.
> 
> This comment seems like it contains info that ought to be part of the class description, rather
> than on an implementation detail.

I modified it a bit and moved to the class description.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28264#discussion_r2549069235
PR Review Comment: https://git.openjdk.org/jdk/pull/28264#discussion_r2549068563


More information about the hotspot-dev mailing list