summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_kse.c13
-rw-r--r--sys/kern/kern_thread.c13
2 files changed, 22 insertions, 4 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 6bcd1b2..d4e74f0 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -357,8 +357,17 @@ kse_release(struct thread *td, struct kse_release_args *uap)
/* NOTREACHED */
} else {
mtx_unlock_spin(&sched_lock);
- PROC_UNLOCK(p);
- return EWOULDBLOCK;
+ if (td->td_standin == NULL) {
+ PROC_UNLOCK(p);
+ td->td_standin = thread_alloc();
+ PROC_LOCK(p);
+ }
+ msleep(p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH,
+ "pause", 0);
+ mtx_lock_spin(&sched_lock);
+ td->td_flags &= ~TDF_UNBOUND;
+ thread_schedule_upcall(td, td->td_kse);
+ thread_exit();
}
}
return (EINVAL);
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 6bcd1b2..d4e74f0 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -357,8 +357,17 @@ kse_release(struct thread *td, struct kse_release_args *uap)
/* NOTREACHED */
} else {
mtx_unlock_spin(&sched_lock);
- PROC_UNLOCK(p);
- return EWOULDBLOCK;
+ if (td->td_standin == NULL) {
+ PROC_UNLOCK(p);
+ td->td_standin = thread_alloc();
+ PROC_LOCK(p);
+ }
+ msleep(p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH,
+ "pause", 0);
+ mtx_lock_spin(&sched_lock);
+ td->td_flags &= ~TDF_UNBOUND;
+ thread_schedule_upcall(td, td->td_kse);
+ thread_exit();
}
}
return (EINVAL);
OpenPOWER on IntegriCloud