红色的行是偏向锁被激活的地方。
The line annotated in red is where biased locking is enabled.
如果锁刚好只被一个线程访问,则可以使用偏向锁。
If the lock happens to be accessed by only one thread, biased locking can be applied.
从最初的基准测试结果来看,偏向锁提供了最佳的性能,比其他的优化方式更有效。
The initial benchmarking results demonstrated that biased locking provided the best performance gain compared to any of the other available optimizations.
应用推荐