A new lightweight locking mechanism for object monitor locking was introduced in JDK 21 under JDK-8291555. The `LockingMode` flag was introduced to allow selection of this new mechanism (`LM_LIGHTWEIGHT`, value 2) in place of the default mechanism (`LM_LEGACY`, value 1). In JDK 23, the `LockingMode` default was changed to `LM_LIGHTWEIGHT`.
In JDK 24, the `LockingMode` flag, along with the `LM_LEGACY` (1) and `LM_MONITOR` (0) modes are deprecated. The default locking mode `LM_LIGHTWEIGHT` will be the only internal implementation that is supported when these locking modes become obsolete in a future release.
This is not expected to change any semantic behavior of Java monitor locking and it is expected to be performance neutral for almost all applications.