summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_rwlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r--sys/kern/kern_rwlock.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index 370d0d6..6541724 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -268,7 +268,7 @@ _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line)
__rw_wlock(rw, curthread, file, line);
LOCK_LOG_LOCK("WLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line);
WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE, file, line);
- curthread->td_locks++;
+ TD_LOCKS_INC(curthread);
}
int
@@ -303,7 +303,7 @@ __rw_try_wlock(volatile uintptr_t *c, const char *file, int line)
if (!rw_recursed(rw))
LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire,
rw, 0, 0, file, line, LOCKSTAT_WRITER);
- curthread->td_locks++;
+ TD_LOCKS_INC(curthread);
}
return (rval);
}
@@ -325,8 +325,9 @@ _rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line)
LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file,
line);
__rw_wunlock(rw, curthread, file, line);
- curthread->td_locks--;
+ TD_LOCKS_DEC(curthread);
}
+
/*
* Determines whether a new reader can acquire a lock. Succeeds if the
* reader already owns a read lock and the lock is locked for read to
@@ -565,7 +566,7 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
waittime, file, line, LOCKSTAT_READER);
LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line);
WITNESS_LOCK(&rw->lock_object, 0, file, line);
- curthread->td_locks++;
+ TD_LOCKS_INC(curthread);
curthread->td_rw_rlocks++;
}
@@ -596,7 +597,7 @@ __rw_try_rlock(volatile uintptr_t *c, const char *file, int line)
WITNESS_LOCK(&rw->lock_object, LOP_TRYLOCK, file, line);
LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire,
rw, 0, 0, file, line, LOCKSTAT_READER);
- curthread->td_locks++;
+ TD_LOCKS_INC(curthread);
curthread->td_rw_rlocks++;
return (1);
}
@@ -714,7 +715,7 @@ _rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line)
break;
}
LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, LOCKSTAT_READER);
- curthread->td_locks--;
+ TD_LOCKS_DEC(curthread);
curthread->td_rw_rlocks--;
}
OpenPOWER on IntegriCloud