Need to set the running flag outside of the thread.

Otherwise, it is likely that the manager will not
see that the worker is running and join immediately.