默认情况下,锁计数器不会被收集。
每一列的高度基于慢锁计数的值,它与图中的所有列有关。
The height of each column is based on the value of the slow lock count and is relative to all the columns in the graph.
因为本例中的写操作违反了使用volatile的第一个条件,因此不能使用volatile安全地实现计数器——您必须使用锁。
Because the writes in this case violate the first condition for using volatile, you cannot use volatile to safely implement the counter — you must use locking.
应用推荐