From 6f7c428a34a5f5c924fb1a87113cb8a1db9a14cd Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 25 May 2018 10:19:17 +0900 Subject: [PATCH] terminate: fix oversubscribe hang when waiting for other threads on same CPU to die Change-Id: I8c4fbdd3aab9d0567ce5457a4a6405490608925d --- kernel/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index 8d07c770..9ad47661 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1049,7 +1049,8 @@ void terminate(int rc, int sig) break; } __mcs_rwlock_reader_unlock(&proc->threads_lock, &lock); - cpu_pause(); + /* We might be waiting for another thread on same CPU */ + schedule(); } mcs_rwlock_writer_lock(&proc->threads_lock, &lock);