summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2008-10-15 06:31:37 +0000
committerdavidxu <davidxu@FreeBSD.org>2008-10-15 06:31:37 +0000
commit5068f6dcf0f3c2ae8be0b0774cd1d74f11085fbd (patch)
treeb5ea5e6ee198214fb2b60f739b585b03f37900b2 /sys/kern/kern_thread.c
parente5b69cb78e39e1043228664f5667e46f361af000 (diff)
downloadFreeBSD-src-5068f6dcf0f3c2ae8be0b0774cd1d74f11085fbd.zip
FreeBSD-src-5068f6dcf0f3c2ae8be0b0774cd1d74f11085fbd.tar.gz
Move per-thread userland debugging flags into seperated field,
this eliminates some problems of locking, e.g, a thread lock is needed but can not be used at that time. Only the process lock is needed now for new field.
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index bb87696..7298edc 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -563,8 +563,6 @@ thread_single(int mode)
if (TD_IS_INHIBITED(td2)) {
switch (mode) {
case SINGLE_EXIT:
- if (td->td_flags & TDF_DBSUSPEND)
- td->td_flags &= ~TDF_DBSUSPEND;
if (TD_IS_SUSPENDED(td2))
wakeup_swapper |=
thread_unsuspend_one(td2);
@@ -685,7 +683,7 @@ thread_suspend_check(int return_instead)
mtx_assert(&Giant, MA_NOTOWNED);
PROC_LOCK_ASSERT(p, MA_OWNED);
while (P_SHOULDSTOP(p) ||
- ((p->p_flag & P_TRACED) && (td->td_flags & TDF_DBSUSPEND))) {
+ ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) {
if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) {
KASSERT(p->p_singlethread != NULL,
("singlethread not set"));
OpenPOWER on IntegriCloud