Make the running boolean flag volatile to prevent the processor from caching it.