summaryrefslogtreecommitdiff
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2013-03-21 14:06:27 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2013-03-21 14:06:27 +0000
commitd071a6fa33d2e172b562a8e6fd3da1b089d48dd3 (patch)
treeb092b5e06cc6203f2835efa36b0136ddabdce1b8 /sys/kern/kern_thread.c
parentc46262f8109e20617deddebd81374e3e6a219512 (diff)
downloadsrc-test2-d071a6fa33d2e172b562a8e6fd3da1b089d48dd3.tar.gz
src-test2-d071a6fa33d2e172b562a8e6fd3da1b089d48dd3.zip
Notes
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 4f0266b668e7..5da4866d6387 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -795,6 +795,17 @@ thread_suspend_check(int return_instead)
return (ERESTART);
/*
+ * Ignore suspend requests for stop signals if they
+ * are deferred.
+ */
+ if (P_SHOULDSTOP(p) == P_STOPPED_SIG &&
+ td->td_flags & TDF_SBDRY) {
+ KASSERT(return_instead,
+ ("TDF_SBDRY set for unsafe thread_suspend_check"));
+ return (0);
+ }
+
+ /*
* If the process is waiting for us to exit,
* this thread should just suicide.
* Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE.