https://medium.com/swlh/how-to-properly-use-synchronized-and-volatile-in-your-java-application-6f4d1f515820