diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-02-26 19:05:13 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-02-26 19:05:13 +0000 |
commit | 03d72b2dffe3c18aef2d89e8059a2982ca0a85bc (patch) | |
tree | b0d07b1430cd348c6a16bffecbac2f181cd33755 /sys/kern | |
parent | 7816149d47ddbc9978f65564980e2ba4bdc52693 (diff) | |
download | FreeBSD-src-03d72b2dffe3c18aef2d89e8059a2982ca0a85bc.zip FreeBSD-src-03d72b2dffe3c18aef2d89e8059a2982ca0a85bc.tar.gz |
Add rw_wowned() interface to rwlock(9), allowing a kernel thread to
determine if it holds an exclusive rwlock reference or not. This is
non-ideal, but recursion scenarios in the network stack currently
require it.
Approved by: jhb
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_rwlock.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index a59de60..18e9a54 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -108,6 +108,13 @@ rw_sysinit(void *arg) rw_init(args->ra_rw, args->ra_desc); } +int +rw_wowned(struct rwlock *rw) +{ + + return (rw_wowner(rw) == curthread); +} + void _rw_wlock(struct rwlock *rw, const char *file, int line) { |