Though I guess a global flag might work too, if I didn't mind forcing the task scheduler to wait on it.