Protect restart to avoid multiple threads from stepping on each other