RFR: 8361705: Clean up KlassCleaningTask

Thomas Schatzl tschatzl at openjdk.org
Wed Jul 16 07:22:46 UTC 2025


On Mon, 14 Jul 2025 10:16:56 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Hi all,
>> 
>>   please review this cleanup of `KlassCleaningTask`, fixing some style issues.
>> 
>> Testing: gha
>> 
>> Thanks,
>>   Thomas
>
> src/hotspot/share/gc/shared/parallelCleaning.cpp line 107:
> 
>> 105:   }
>> 106: 
>> 107:   return !Atomic::cmpxchg(&_clean_klass_tree_claimed, false, true);
> 
> Generally, I prefer to see `Atomic::cmpxchg(&_clean_klass_tree_claimed, false, true) == false`, because `false` here is not about the logical boolean expression, but about the "old" value`false`, which just happens to be a boolean.

I'll ask internally first too, and then fix all of these occurrences at once if needed.

That particular occurrence may go away soon too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26289#discussion_r2209502714


More information about the hotspot-gc-dev mailing list