mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
Kernel+LibC: Add exit_thread() syscall.
This commit is contained in:
parent
02b69cf06a
commit
d07be1087a
6 changed files with 26 additions and 0 deletions
|
@ -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 (¤t->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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue