From aa2dc0a5d9e7a19420c153cd414fefa8498eab71 Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 29 Jun 2002 17:26:22 +0000 Subject: Part 1 of KSE-III The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals.. --- sys/kern/sys_process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/kern/sys_process.c') diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index dacb9d9..ab6f1e8 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -467,7 +467,7 @@ ptrace(struct thread *td, struct ptrace_args *uap) } /* not currently stopped */ - if (p->p_stat != SSTOP || (p->p_flag & P_WAITED) == 0) { + if (!P_SHOULDSTOP(p) || (p->p_flag & P_WAITED) == 0) { error = EBUSY; goto fail; } @@ -566,10 +566,12 @@ ptrace(struct thread *td, struct ptrace_args *uap) if (proctree_locked) sx_xunlock(&proctree_lock); /* deliver or queue signal */ - if (p->p_stat == SSTOP) { + if (P_SHOULDSTOP(p)) { p->p_xstat = uap->data; mtx_lock_spin(&sched_lock); + p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SGNL); setrunnable(td2); /* XXXKSE */ + /* Need foreach kse in proc, ... make_kse_queued(). */ mtx_unlock_spin(&sched_lock); } else if (uap->data) psignal(p, uap->data); -- cgit v1.1