@anathan you don't need volatile if the field is only accessed within  synchronized scope of the same object. In this case synchronized(handshakeLock) { ... }