automatic line phase locking 自动行相位锁定
If this code is interrupted by another thread after executing line C3 but before completing the constructor, double-checked locking fails.
如果此代码在执行c 3行后且在完成该构造函数前被另一个线程中断,则双重检查锁定就会失败。
The bottom line is that double-checked locking, in whatever form, should not be used because you cannot guarantee that it will work on any JVM implementation.
无论以何种形式,都不应使用双重检查锁定,因为您不能保证它在任何 JVM 实现上都能顺利运行。
The line annotated in red is where biased locking is enabled.
红色的行是偏向锁被激活的地方。
应用推荐