summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.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_sig.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_sig.c')
-rw-r--r--sys/kern/kern_sig.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index d5d1813..f4cf8ad 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2342,16 +2342,12 @@ ptracestop(struct thread *td, int sig)
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK,
&p->p_mtx.lock_object, "Stopping for traced signal");
- thread_lock(td);
- td->td_flags |= TDF_XSIG;
- thread_unlock(td);
+ td->td_dbgflags |= TDB_XSIG;
td->td_xsig = sig;
PROC_SLOCK(p);
- while ((p->p_flag & P_TRACED) && (td->td_flags & TDF_XSIG)) {
+ while ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_XSIG)) {
if (p->p_flag & P_SINGLE_EXIT) {
- thread_lock(td);
- td->td_flags &= ~TDF_XSIG;
- thread_unlock(td);
+ td->td_dbgflags &= ~TDB_XSIG;
PROC_SUNLOCK(p);
return (sig);
}
@@ -2368,7 +2364,7 @@ stopme:
if (!(p->p_flag & P_TRACED)) {
break;
}
- if (td->td_flags & TDF_DBSUSPEND) {
+ if (td->td_dbgflags & TDB_SUSPEND) {
if (p->p_flag & P_SINGLE_EXIT)
break;
goto stopme;
OpenPOWER on IntegriCloud