>> You can as well use AtomicBoolean, which has an extra benefit of having >> defined behaviour in multithreaded case. >> > > And the extra disadvantage of having a much higher performance overhead in > the single-threaded case. > The example he gave, which was Swing-based, was inherently multi-threaded.