summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-11-10 15:06:30 +0000
committerrwatson <rwatson@FreeBSD.org>2007-11-10 15:06:30 +0000
commit9162bf224ccd6379570f9292c0a8c8f56e47483a (patch)
treeac64fe62a0eb40219166a0ac453eb47a39724315 /sys
parent4a3708c0c32da7c70de4a7ece2f3e37951bf40cf (diff)
downloadFreeBSD-src-9162bf224ccd6379570f9292c0a8c8f56e47483a.zip
FreeBSD-src-9162bf224ccd6379570f9292c0a8c8f56e47483a.tar.gz
Add rm_wowned(9) function to test whether the current thread owns an
exclusive lock on the passed rmlock. Reviewed by: ups
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_rmlock.c7
-rw-r--r--sys/sys/rmlock.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c
index 5a91811..276aee6 100644
--- a/sys/kern/kern_rmlock.c
+++ b/sys/kern/kern_rmlock.c
@@ -175,6 +175,13 @@ rm_destroy(struct rmlock *rm)
lock_destroy(&rm->lock_object);
}
+int
+rm_wowned(struct rmlock *rm)
+{
+
+ return (mtx_owned(&rm->rm_lock));
+}
+
void
rm_sysinit(void *arg)
{
diff --git a/sys/sys/rmlock.h b/sys/sys/rmlock.h
index 04ccb38..ab0b566 100644
--- a/sys/sys/rmlock.h
+++ b/sys/sys/rmlock.h
@@ -42,6 +42,7 @@
void rm_init(struct rmlock *rm, const char *name, int opts);
void rm_destroy(struct rmlock *rm);
+int rm_wowned(struct rmlock *rm);
void rm_sysinit(void *arg);
OpenPOWER on IntegriCloud