diff options
author | melifaro <melifaro@FreeBSD.org> | 2012-03-26 09:34:17 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2012-03-26 09:34:17 +0000 |
commit | fd561480db34c3cacc88ece00cce76c6dd422eca (patch) | |
tree | d4649d8e9dbd56ee9b1ecddc94a142edd3887823 /share | |
parent | 72dcb65231efbb0d266e4f5eee4753de4b5b8394 (diff) | |
download | FreeBSD-src-fd561480db34c3cacc88ece00cce76c6dd422eca.zip FreeBSD-src-fd561480db34c3cacc88ece00cce76c6dd422eca.tar.gz |
- Add knlist_init_rw_reader() function to kqueue(9).
Function acquired reader lock if needed.
Assert check for reader or writer lock (RA_LOCKED / RA_UNLOCKED)
- While here, add knlist_init_mtx.9 to MLINKS and fix some style(9) issues
Reviewed by: glebius
Approved by: ae(mentor)
MFC after: 2 weeks
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/Makefile | 2 | ||||
-rw-r--r-- | share/man/man9/kqueue.9 | 23 |
2 files changed, 22 insertions, 3 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 8acef35..e5778a1 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -773,6 +773,8 @@ MLINKS+=kqueue.9 knlist_add.9 \ kqueue.9 knlist_destroy.9 \ kqueue.9 knlist_empty.9 \ kqueue.9 knlist_init.9 \ + kqueue.9 knlist_init_mtx.9 \ + kqueue.9 knlist_init_rw_reader.9 \ kqueue.9 knlist_remove.9 \ kqueue.9 knlist_remove_inevent.9 \ kqueue.9 knote_fdclose.9 \ diff --git a/share/man/man9/kqueue.9 b/share/man/man9/kqueue.9 index 2ecc08b..555fe54 100644 --- a/share/man/man9/kqueue.9 +++ b/share/man/man9/kqueue.9 @@ -24,14 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd March 26, 2012 .Dt KQUEUE 9 .Os .Sh NAME .Nm kqueue_add_filteropts , kqueue_del_filteropts , .Nm kqfd_register , .Nm knote_fdclose , -.Nm knlist_init , knlist_init_mtx , +.Nm knlist_init , knlist_init_mtx , knlist_init_rw_reader , .Nm knlist_add , knlist_remove , knlist_remove_inevent , knlist_empty , .Nm knlist_clear , knlist_delete , knlist_destroy , .Nm KNOTE_LOCKED , KNOTE_UNLOCKED @@ -57,6 +57,8 @@ .Ft void .Fn knlist_init_mtx "struct knlist *knl" "struct mtx *lock" .Ft void +.Fn knlist_init_rw_reader "struct knlist *knl" "struct rwlock *lock" +.Ft void .Fn knlist_add "struct knlist *knl" "struct knote *kn" "int islocked" .Ft void .Fn knlist_remove "struct knlist *knl" "struct knote *kn" "int islocked" @@ -259,8 +261,10 @@ If used, the .Vt knlist must be initialized with either .Fn knlist_init +, +.Fn knlist_init_mtx or -.Fn knlist_init_mtx . +.Fn knlist_init_rw_reader . The .Vt knlist structure may be embedded into the object structure. @@ -305,6 +309,19 @@ style lock. .Pp The function +.Fn knlist_init_rw_reader +may be used to initialize a +.Vt knlist +when +.Fa lock +is a +.Xr rwlock 9 +read lock. +Lock is acquired via +.Fn rw_rlock +function. +.Pp +The function .Fn knlist_empty returns true when there are no .Vt knotes |