This isn't thread-safe. It's probably best to just use ```synchronized``` methods, but for a small example like this ```volatile``` should work too.