예제 #1
0
파일: thread.c 프로젝트: looncraz/haiku
void
exit_thread(status_t status)
{
	_thread_do_exit_work();
	__heap_thread_exit();
	_kern_exit_thread(status);
}
예제 #2
0
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;
}
예제 #3
0
파일: exit.c 프로젝트: mmanley/Antares
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);
}