These are remnants of the thread state coordinator, which are now unnecessary. I have basically
inlined the callbacks. No functional change.
PS: This is logically independent on D9321, but should be applied on top of it. Otherwise,
trivial but annoing merge errors may occur.
I know it's probably going to be a pain in the ass, but could you make all of these return Error (and propagate them?) since you're getting rid of the error_function?