Don't busy-wait when no threads are running