kernel: Retrieve all thread information before marking it as dead in waitpid()
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
In case we get interrupted by the reaper thread.
This commit is contained in:
parent
54a4ebe5bb
commit
4d3050eaab
@ -43,11 +43,12 @@ Result<u64> sys_waitpid(Registers*, SyscallArgs args)
|
||||
return err(ENOTSUP);
|
||||
|
||||
int status = (int)thread->status;
|
||||
u64 id = thread->id;
|
||||
|
||||
thread->state = ThreadState::Dying;
|
||||
|
||||
if (status_ptr)
|
||||
if (!MemoryManager::copy_to_user_typed(status_ptr, &status)) return err(EFAULT);
|
||||
|
||||
return thread->id;
|
||||
return id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user