diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2011-11-18 09:12:26 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2011-11-18 09:12:26 +0000 |
commit | 7b5190779b459031cc46fe9850c5cfb196c55ebe (patch) | |
tree | 2947b2e820c322b723e3a4a24ae2b79191b3f1ec | |
parent | dfdda192660d9a94944d03a43cc1a729ef7ff965 (diff) |
Notes
-rw-r--r-- | sys/kern/kern_thread.c | 7 | ||||
-rw-r--r-- | sys/sys/proc.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 29bdaa20e032..d9df5c31e2aa 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -566,6 +566,8 @@ calc_remaining(struct proc *p, int mode) { int remaining; + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); if (mode == SINGLE_EXIT) remaining = p->p_numthreads; else if (mode == SINGLE_BOUNDARY) @@ -819,8 +821,11 @@ thread_suspend_check(int return_instead) td->td_flags &= ~TDF_BOUNDARY; thread_unlock(td); PROC_LOCK(p); - if (return_instead == 0) + if (return_instead == 0) { + PROC_SLOCK(p); p->p_boundary_count--; + PROC_SUNLOCK(p); + } } return (0); } diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 813c2362d5aa..82cdae106bf1 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -532,7 +532,7 @@ struct proc { struct thread *p_singlethread;/* (c + j) If single threading this is it */ int p_suspcount; /* (j) Num threads in suspended mode. */ struct thread *p_xthread; /* (c) Trap thread */ - int p_boundary_count;/* (c) Num threads at user boundary */ + int p_boundary_count;/* (j) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ struct itimers *p_itimers; /* (c) POSIX interval timers. */ struct procdesc *p_procdesc; /* (e) Process descriptor, if any. */ |