just FYI, todays update of VEXcode now has a “stop all tasks” class member function for task and thread.
task::stopAll();
or
thread::interruptAll();
main will not be stopped, events will not be unregistered. motors will continue to run if field control still has the robot enabled.