From 0a55db5302a78ea51a1b4e4ff3ba632f34b2f6af Mon Sep 17 00:00:00 2001 From: Sergio López Date: Tue, 27 Sep 2011 15:52:51 +0200 Subject: Make thread_suspend honor the TH_UNINT flag Interrupting a thread without a continuation, puts it in a inconsistent state. This is the cause for the bug described in https://lists.gnu.org/archive/html/bug-hurd/2011-09/msg00148.html * kern/thread.c (thread_suspend): Fail with KERN_FAILURE if thread is uninterruptible. --- kern/thread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kern/thread.c b/kern/thread.c index 1548e143..bf2df94f 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -1329,6 +1329,11 @@ kern_return_t thread_suspend( hold = FALSE; spl = splsched(); thread_lock(thread); + if (thread->state & TH_UNINT) { + thread_unlock(thread); + (void) splx(spl); + return KERN_FAILURE; + } if (thread->user_stop_count++ == 0) { hold = TRUE; thread->suspend_count++; -- cgit v1.2.3