Such variables must be volatile if they can be accessed elsewhere without blocking. For example, as a read-only quick access to a variable size. Lock methods perform the same task as a synchronized block. See the "Memory sync" section in javadoc for the Lock class.
source share