commit 9009cda6c00522e802a5266d1544f58183fd7c2e parent f7cf4871113d42a46fccb1f3918e59026645f54f Author: Roberto E. Vargas Caballero <roberto.vargas@midokura.com> Date: Fri, 18 Nov 2022 15:29:26 +0100 os9: Implement deltask() Diffstat:
M | src/os9/proc.c | | | 13 | +++++++++---- |
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/os9/proc.c b/src/os9/proc.c @@ -342,9 +342,17 @@ freemap(Map *mp) unlock(&mappool.m); } +/* + * tp must be blocked when this function is called + */ static void deltask(Task *tp) { + freemap(tp->text); + freemap(tp->data); + freespace(tp->ns); + freefds(tp->fds); + unlocktask(tp); } static Task * @@ -399,7 +407,6 @@ clone(Task *parent) return tp; err: - unlocktask(tp); deltask(tp); return NULL; } @@ -486,10 +493,8 @@ err: if (ns) freespace(ns); - if (flags & RFPROC) { - unlocktask(tp); + if (flags & RFPROC) deltask(tp); - } return -1; }