Using an atomic allows us to avoid locking the whole object all time time. As suggested by Stefan Kost.