On Tue, 22 Jun 2021 15:43:34 GMT, Daniel D. Daugherty <[email protected]> 
wrote:

>> src/hotspot/share/runtime/objectMonitor.cpp line 575:
>> 
>>> 573:     // Make a zero contentions field negative to force any contending 
>>> threads
>>> 574:     // to retry. This is the second part of the async deflation dance.
>>> 575:     if (Atomic::cmpxchg(&_contentions, (int)0, INT32_MIN) != 0) {
>> 
>> INT_MIN
>> 
>> Do we really need the cast on 0?
>
> The original cast of `(jint)0` was to get the right `cmpxchg()` selected.
> I _think_ that with the switch to INT32_MIN, a regular `0` instead of `(int)0`
> should compile.

Yes, changing to INT_MIN is more correct and I don't need the cast to int now 
for zero.  Recompiling on all platforms, including the picky ones for 
verification.  Thanks!

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

PR: https://git.openjdk.java.net/jdk/pull/3980

Reply via email to