diff options
author | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
commit | 5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch) | |
tree | b1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/kern/kern_lock.c | |
parent | 83e00d4274950d2b531c24692cd123538ffbddb9 (diff) | |
download | FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz |
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 147508c..3f8373b 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -208,14 +208,14 @@ acquire(struct lock *lkp, int extflags, int wanted) { */ int #ifndef DEBUG_LOCKS -lockmgr(lkp, flags, interlkp, p) +lockmgr(lkp, flags, interlkp, td) #else -debuglockmgr(lkp, flags, interlkp, p, name, file, line) +debuglockmgr(lkp, flags, interlkp, td, name, file, line) #endif struct lock *lkp; u_int flags; struct mtx *interlkp; - struct proc *p; + struct thread *td; #ifdef DEBUG_LOCKS const char *name; /* Name of lock function */ const char *file; /* Name of file call is from */ @@ -228,13 +228,13 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line) CTR5(KTR_LOCKMGR, "lockmgr(): lkp == %p (lk_wmesg == \"%s\"), flags == 0x%x, " - "interlkp == %p, p == %p", lkp, lkp->lk_wmesg, flags, interlkp, p); + "interlkp == %p, td == %p", lkp, lkp->lk_wmesg, flags, interlkp, td); error = 0; - if (p == NULL) + if (td == NULL) pid = LK_KERNPROC; else - pid = p->p_pid; + pid = td->td_proc->p_pid; mtx_lock(lkp->lk_interlock); if (flags & LK_INTERLOCK) { @@ -257,19 +257,19 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line) * while there is an exclusive lock holder or while an * exclusive lock request or upgrade request is in progress. * - * However, if P_DEADLKTREAT is set, we override exclusive + * However, if TDF_DEADLKTREAT is set, we override exclusive * lock requests or upgrade requests ( but not the exclusive * lock itself ). */ if (lkp->lk_lockholder != pid) { lockflags = LK_HAVE_EXCL; - if (p) { - PROC_LOCK(p); - if (!(p->p_flag & P_DEADLKTREAT)) { + if (td) { + PROC_LOCK(td->td_proc); + if (!(td->td_flags & TDF_DEADLKTREAT)) { lockflags |= LK_WANT_EXCL | LK_WANT_UPGRADE; } - PROC_UNLOCK(p); + PROC_UNLOCK(td->td_proc); } error = acquire(lkp, extflags, lockflags); if (error) @@ -560,15 +560,15 @@ lockdestroy(lkp) * Determine the status of a lock. */ int -lockstatus(lkp, p) +lockstatus(lkp, td) struct lock *lkp; - struct proc *p; + struct thread *td; { int lock_type = 0; mtx_lock(lkp->lk_interlock); if (lkp->lk_exclusivecount != 0) { - if (p == NULL || lkp->lk_lockholder == p->p_pid) + if (td == NULL || lkp->lk_lockholder == td->td_proc->p_pid) lock_type = LK_EXCLUSIVE; else lock_type = LK_EXCLOTHER; |