summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kern/thread.c b/kern/thread.c
index d279bc8..87be923 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -1326,10 +1326,12 @@ kern_return_t thread_suspend(
hold = FALSE;
spl = splsched();
thread_lock(thread);
- if (thread->state & TH_UNINT) {
+ /* Wait for thread to get interruptible */
+ while (thread->state & TH_UNINT) {
+ assert_wait(&thread->state, TRUE);
thread_unlock(thread);
- (void) splx(spl);
- return KERN_FAILURE;
+ thread_block(NULL);
+ thread_lock(thread);
}
if (thread->user_stop_count++ == 0) {
hold = TRUE;