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);