noreturn int shim_do_exit_group (int error_code) { INC_PROFILE_OCCURENCE(syscall_use_ipc); struct shim_thread * cur_thread = get_cur_thread(); assert(!is_internal(cur_thread)); if (debug_handle) sysparser_printf("---- shim_exit_group (returning %d)\n", error_code); if (cur_thread->dummy) { cur_thread->term_signal = 0; thread_exit(cur_thread, true); switch_dummy_thread(cur_thread); } debug("now kill other threads in the process\n"); do_kill_proc(cur_thread->tgid, cur_thread->tgid, SIGKILL, false); debug("now exit the process\n"); try_process_exit(error_code, 0); #ifdef PROFILE if (ENTER_TIME) SAVE_PROFILE_INTERVAL_SINCE(syscall_exit_group, ENTER_TIME); #endif DkThreadExit(); }
static void sighandler_kill (int sig, siginfo_t * info, void * ucontext) { if (sig <= NUM_KNOWN_SIGS) debug("killed by %s\n", siglist[sig]); else debug("killed by signal %d\n", sig); if (!info->si_pid) switch(sig) { case SIGTERM: case SIGINT: shim_do_kill(-1, sig); break; } try_process_exit(0); DkThreadExit(); }
noreturn int shim_do_exit (int error_code) { INC_PROFILE_OCCURENCE(syscall_use_ipc); struct shim_thread * cur_thread = get_cur_thread(); assert(!is_internal(cur_thread)); if (debug_handle) sysparser_printf("---- shim_exit (returning %d)\n", error_code); if (cur_thread->dummy) { cur_thread->term_signal = 0; thread_exit(cur_thread, true); switch_dummy_thread(cur_thread); } try_process_exit(error_code, 0); #ifdef PROFILE if (ENTER_TIME) SAVE_PROFILE_INTERVAL_SINCE(syscall_exit, ENTER_TIME); #endif DkThreadExit(); }