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.