Skip to content

Commit 2ece986

Browse files
committed
[docs update]补充偏向锁废弃时间点
1 parent e8dd610 commit 2ece986

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/java/concurrent/java-concurrent-questions-02.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,8 @@ public class SynchronizedDemo2 {
577577

578578
Open JDK 官方声明:[JEP 374: Deprecate and Disable Biased Locking](https://openjdk.org/jeps/374)
579579

580+
在 JDK15 中,偏向锁被默认关闭(仍然可以使用 `-XX:+UseBiasedLocking` 启用偏向锁),在 JDK18 中,偏向锁已经被彻底废弃(无法通过命令行打开)。
581+
580582
在官方声明中,主要原因有两个方面:
581583

582584
- **性能收益不明显:**

0 commit comments

Comments
 (0)