diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2005-03-31 04:25:59 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2005-03-31 04:25:59 +0000 |
| commit | b641353e3a0ba8df05574b675e83f83a16f762c5 (patch) | |
| tree | e18cb093186675e5a2b1728bea1138d0ae297642 /sys/kern/kern_lock.c | |
| parent | 6fe62276bea695ef5a9946538b08eeab00208835 (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_lock.c')
| -rw-r--r-- | sys/kern/kern_lock.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 550538a9bd61..cc415af83abd 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -79,7 +79,6 @@ __FBSDID("$FreeBSD$"); static struct mtx lock_mtx; static int acquire(struct lock **lkpp, int extflags, int wanted); -static int apause(struct lock *lkp, int flags); static int acquiredrain(struct lock *lkp, int extflags) ; static void @@ -113,32 +112,6 @@ shareunlock(struct thread *td, struct lock *lkp, int decr) { } } -/* - * This is the waitloop optimization. - */ -static int -apause(struct lock *lkp, int flags) -{ -#ifdef SMP - int i, lock_wait; -#endif - - if ((lkp->lk_flags & flags) == 0) - return 0; -#ifdef SMP - for (lock_wait = LOCK_WAIT_TIME; lock_wait > 0; lock_wait--) { - mtx_unlock(lkp->lk_interlock); - for (i = LOCK_SAMPLE_WAIT; i > 0; i--) - if ((lkp->lk_flags & flags) == 0) - break; - mtx_lock(lkp->lk_interlock); - if ((lkp->lk_flags & flags) == 0) - return 0; - } -#endif - return 1; -} - static int acquire(struct lock **lkpp, int extflags, int wanted) { @@ -152,12 +125,6 @@ acquire(struct lock **lkpp, int extflags, int wanted) return EBUSY; } - if ((extflags & LK_INTERLOCK) == 0) { - error = apause(lkp, wanted); - if (error == 0) - return 0; - } - s = splhigh(); while ((lkp->lk_flags & wanted) != 0) { lkp->lk_flags |= LK_WAIT_NONZERO; @@ -496,13 +463,6 @@ acquiredrain(struct lock *lkp, int extflags) { if ((extflags & LK_NOWAIT) && (lkp->lk_flags & LK_ALL)) { return EBUSY; } - - if ((extflags & LK_INTERLOCK) == 0) { - error = apause(lkp, LK_ALL); - if (error == 0) - return 0; - } - while (lkp->lk_flags & LK_ALL) { lkp->lk_flags |= LK_WAITDRAIN; error = msleep(&lkp->lk_flags, lkp->lk_interlock, lkp->lk_prio, |
