Switched from Qt thread/mutex and volatile to C++11 thread/mutex/atomic.