void exit_thread(status_t status) { _thread_do_exit_work(); __heap_thread_exit(); _kern_exit_thread(status); }
static status_t thread_entry(void* _entry, void* _thread) { thread_func entry = (thread_func)_entry; pthread_thread* thread = (pthread_thread*)_thread; status_t returnCode; returnCode = entry(thread->entry_argument); _thread_do_exit_work(); return returnCode; }
void exit(int status) { // BeOS on exit notification for the main thread _thread_do_exit_work(); // unwind the exit stack, calling the registered functions _exit_stack_lock(); while (--sExitStackInfo.stack_size >= 0) (*sExitStackInfo.exit_stack[sExitStackInfo.stack_size])(); _exit_stack_unlock(); // close all open files _IO_cleanup(); __gRuntimeLoader->call_termination_hooks(); // exit with status code _kern_exit_team(status); }