PREV UP NEXT StackThreads/MP: version 0.77 User's Guide

3.11: Graceful Exits

        void st_wg_exit(wv);
@        void st_wg_die(wv);
@        void st_app_exit(av);
@        void st_app_die(av);
                void * wv; int av;

st_wg_exit(wv) exits the worker group the calling thread belongs to and returns wv as the return status of the worker group. When the worker group is the toplevel group, the group that executes st_main, it exits the entire application. This is the preferred way of terminating an application.

st_wg_die(lv) behaves like st_wg_exit(av), except that it prints stack trace of the calling worker before exiting. It is advisable to call this procedure whenever a fatal error occurs, so that the application prints some useful pieces of information for debugging.

st_app_exit(av) simply kills the entire application by exit(av) on UNIX. st_app_die(av)) behaves like st_app_exit(av), except it prints the stack trace of the calling worker before dying.