-
Type:
Enhancement
-
Resolution: Duplicate
-
Priority:
P4
-
Affects Version/s: 9
-
Component/s: hotspot
The Lockword in the Mutex/Monitor encodes various bits of information and is usually updated via a full-word atomic CAS. However, an optimization in the unlock path was implemented years ago for sparc/x86 using a non-atomic byte-store of zero into the LSB to clear the lock. It is not clear if architectures other than sparc/x86 guarantee the safety of such mixed accesses and it is suggested to simply replace the store of zero with an atomic decrement.
- duplicates
-
JDK-8210832 Remove sneaky locking in class Monitor
-
- Resolved
-