From e822fc47dde18b8e61e7b1b0591f43941e821cc9 Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Wed, 11 Nov 2015 23:03:43 +0900 Subject: [PATCH] fix dead locking when kill subthreads --- kernel/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index 964f6b4a..52c52ae6 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -598,6 +598,7 @@ terminate(int rc, int sig) } } } + mcs_rwlock_reader_unlock(&proc->threads_lock, &lock); if(ids){ for(i = 0; i < n; i++){ do_kill(mythread, proc->pid, ids[i], SIGKILL, NULL, 0); @@ -605,7 +606,6 @@ terminate(int rc, int sig) kfree(ids); ids = NULL; } - mcs_rwlock_reader_unlock(&proc->threads_lock, &lock); for(;;){ __mcs_rwlock_reader_lock(&proc->threads_lock, &lock);