a variable must be volatile if to be used from multiple threads