1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:57:43 +00:00

Kernel+LibC: Add exit_thread() syscall.

This commit is contained in:
Andreas Kling 2019-04-29 15:17:20 +02:00
parent 02b69cf06a
commit d07be1087a
6 changed files with 26 additions and 0 deletions

View file

@ -2443,6 +2443,18 @@ int Process::sys$create_thread(int(*entry)(void*), void* argument)
return 0;
}
void Process::sys$exit_thread(int code)
{
InterruptDisabler disabler;
if (&current->process().main_thread() == current) {
sys$exit(code);
return;
}
current->set_state(Thread::State::Dying);
Scheduler::pick_next_and_switch_now();
ASSERT_NOT_REACHED();
}
int Process::sys$gettid()
{
return current->tid();