[kernel] Remove status code from thread exit

The status code from thread exit had too many issues, (eg, how does it
relate to process exit code? what happens when different threads exit
with different exit codes?) and not enough value, so I'm getting rid of
it.
This commit is contained in:
Justin C. Miller
2022-10-20 21:49:40 -07:00
parent c02aa084d1
commit 194776d226
6 changed files with 21 additions and 33 deletions

View File

@@ -28,25 +28,25 @@ thread_create(j6_handle_t *self, process *proc, uintptr_t stack_top, uintptr_t e
return j6_status_ok;
}
j6_status_t
thread_exit(int32_t status)
{
thread &th = thread::current();
log::verbose(logs::task, "Thread %llx exiting with code %d", th.koid(), status);
th.exit(status);
log::error(logs::task, "returned to exit syscall");
return j6_err_unexpected;
}
j6_status_t
thread_kill(thread *self)
{
log::verbose(logs::task, "Killing thread %llx", self->koid());
self->exit(-1);
self->exit();
return j6_status_ok;
}
j6_status_t
thread_exit()
{
thread &th = thread::current();
log::verbose(logs::task, "Thread %llx exiting", th.koid());
th.exit();
log::error(logs::task, "returned to exit syscall");
return j6_err_unexpected;
}
j6_status_t
thread_sleep(uint64_t duration)
{