Index: kern_lock.c =================================================================== RCS file: /usr/repo/src/sys/kern/kern_lock.c,v retrieving revision 1.110 diff -u -p -1 -5 -r1.110 kern_lock.c --- kern_lock.c 18 May 2007 15:04:59 -0000 1.110 +++ kern_lock.c 4 Jun 2007 23:05:29 -0000 @@ -252,30 +252,31 @@ _lockmgr(struct lock *lkp, u_int flags, break; sharelock(td, lkp, 1); if (lkp->lk_sharecount == 1) lock_profile_obtain_lock_success(&lkp->lk_object, contested, waitstart, file, line); #if defined(DEBUG_LOCKS) stack_save(&lkp->lk_stack); #endif break; } /* * We hold an exclusive lock, so downgrade it to shared. * An alternative would be to fail with EDEADLK. */ sharelock(td, lkp, 1); + COUNT(td, -1); if (lkp->lk_sharecount == 1) lock_profile_obtain_lock_success(&lkp->lk_object, contested, waitstart, file, line); /* FALLTHROUGH downgrade */ case LK_DOWNGRADE: KASSERT(lkp->lk_lockholder == thr && lkp->lk_exclusivecount != 0, ("lockmgr: not holding exclusive lock " "(owner thread (%p) != thread (%p), exlcnt (%d) != 0", lkp->lk_lockholder, thr, lkp->lk_exclusivecount)); sharelock(td, lkp, lkp->lk_exclusivecount); COUNT(td, -lkp->lk_exclusivecount); lkp->lk_exclusivecount = 0; lkp->lk_flags &= ~LK_HAVE_EXCL; lkp->lk_lockholder = LK_NOPROC; if (lkp->lk_waitcount)