Spawn new tasks onto the primary scheduler by default. #3760
Add at_exit function #4450