mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 21:58:20 +00:00
scheduler: pid refcount
This commit is contained in:
@@ -57,6 +57,8 @@ syscallret_t syscall_fork(context_t *ctx) {
|
||||
ret.ret = nproc->pid;
|
||||
|
||||
sched_queue(nthread);
|
||||
// proc starts with 1 refcount, release it here as to only have the thread reference
|
||||
PROC_RELEASE(nproc);
|
||||
|
||||
cleanup:
|
||||
return ret;
|
||||
|
||||
@@ -75,6 +75,7 @@ syscallret_t syscall_waitpid(context_t *context, pid_t pid, int *status, int opt
|
||||
ret.errno = 0;
|
||||
|
||||
__assert(iterator);
|
||||
sched_destroyproc(iterator);
|
||||
// process will no longer be referenced by the child list
|
||||
PROC_RELEASE(iterator);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user