Acquire lock before manipulating controllers.

Make sure that no two threads can manipulate (start, stop or restart) controllers simultaneously.