diff options
author | arr <arr@FreeBSD.org> | 2002-04-02 17:21:00 +0000 |
---|---|---|
committer | arr <arr@FreeBSD.org> | 2002-04-02 17:21:00 +0000 |
commit | 85f5ae7a3be5ba48dbb5746bdd55b5f3c6c91128 (patch) | |
tree | 1bcd5fa5a884cb73126c2ac5737fdb99b2858d9b /share | |
parent | 448edc64b41e8d0220c4eaa170ff10164700ec44 (diff) | |
download | FreeBSD-src-85f5ae7a3be5ba48dbb5746bdd55b5f3c6c91128.zip FreeBSD-src-85f5ae7a3be5ba48dbb5746bdd55b5f3c6c91128.tar.gz |
- Add notes about SX_SYSINIT and MTX_SYSINIT in order to document the
recent additions of these macros.
- Add in a MLINK to create SX_SYSINIT.9 and MTX_SYSINIT.9.
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/Makefile | 2 | ||||
-rw-r--r-- | share/man/man9/mutex.9 | 14 | ||||
-rw-r--r-- | share/man/man9/sx.9 | 17 |
3 files changed, 30 insertions, 3 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index c401e15..a91cc9c 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -203,6 +203,7 @@ MLINKS+=sx.9 sx_sunlock.9 MLINKS+=sx.9 sx_xunlock.9 MLINKS+=sx.9 sx_try_upgrade.9 MLINKS+=sx.9 sx_downgrade.9 +MLINKS+=sx.9 SX_SYSINIT.9 MLINKS+=time.9 boottime.9 time.9 mono_time.9 time.9 runtime.9 MLINKS+=timeout.9 untimeout.9 MLINKS+=timeout.9 callout_handle_init.9 timeout.9 callout_init.9 @@ -322,6 +323,7 @@ MLINKS+=mutex.9 mtx_unlock_spin.9 mutex.9 mtx_unlock_spin_flags.9 MLINKS+=mutex.9 mtx_destroy.9 MLINKS+=mutex.9 mtx_initialized.9 mutex.9 mtx_owned.9 MLINKS+=mutex.9 mtx_recursed.9 mutex.9 mtx_assert.9 +MLINKS+=mutex.9 MTX_SYSINIT.9 MLINKS+=kobj.9 kobj_class_compile.9 MLINKS+=kobj.9 kobj_class_compile_static.9 diff --git a/share/man/man9/mutex.9 b/share/man/man9/mutex.9 index 76a6a49..ddd1d2b 100644 --- a/share/man/man9/mutex.9 +++ b/share/man/man9/mutex.9 @@ -48,7 +48,8 @@ .Nm mtx_initialized , .Nm mtx_owned , .Nm mtx_recursed , -.Nm mtx_assert +.Nm mtx_assert, +.Nm MTX_SYSINIT .Nd kernel synchronization primitives .Sh SYNOPSIS .In sys/param.h @@ -86,6 +87,7 @@ .Fn mtx_recursed "struct mtx *mutex" .Ft void .Fn mtx_assert "struct mtx *mutex" "int what" +.Fn MTX_SYSINIT "name" "mtx" "description" "opts" .Sh DESCRIPTION Mutexes are the most basic and primary method of process synchronization. The major design considerations for mutexes are: @@ -360,6 +362,16 @@ pointed to by the first argument. This assertion is only valid in conjunction with .Dv MA_OWNED . .El +.Pp +The +.Fn MTX_SYSINIT +macro is used to generate a call to the +.Fn mtx_sysinit +routine at system startup in order to initialize a given mutex lock. The parameters are the same as +.Fn mtx_init +but with an additional argument, +.Fa name, +that is used in generating unique variable names for the related structures associated with the lock and the sysinit routine. .Ss The Default Mutex Type Most kernel code should use the default lock type, .Dv MTX_DEF ; diff --git a/share/man/man9/sx.9 b/share/man/man9/sx.9 index bb634d0..7bb5f12 100644 --- a/share/man/man9/sx.9 +++ b/share/man/man9/sx.9 @@ -41,7 +41,8 @@ .Nm sx_xunlock , .Nm sx_try_upgrade , .Nm sx_downgrade , -.Nm sx_assert +.Nm sx_assert, +.Nm SX_SYSINIT .Nd kernel shared/exclusive lock .Sh SYNOPSIS .In sys/param.h @@ -70,6 +71,7 @@ .Fn sx_downgrade "struct sx *sx" .Ft void .Fn sx_assert "struct sx *sx" "int what" +.Fn SX_SYSINIT "name" "sx" "description" .Sh DESCRIPTION Shared/exclusive locks are used to protect data that are read far more often than they are written. @@ -106,7 +108,7 @@ lock by calling A thread that owns an exclusive lock can downgrade it to a shared lock by calling .Fn sx_downgrade . -.Pp +.PP .Fn sx_try_slock and .Fn sx_try_xlock @@ -124,6 +126,17 @@ The function tests specified conditions and panics if they are not met and the kernel is compiled with .Dv INVARIANTS . +.Pp +The +.Fn SX_SYSINIT +macro is used to generate a call to the +.Fn sx_sysinit +routine at system startup in order to initialize a given sx lock. The parameters are the same as +.Fn sx_init +but with an additional argument, +.Fa name, +that is used in generating unique variable names for the related structures associated with the lock and the sysinit routine. +.Pp The following assertions are supported: .Bl -tag -width ".Dv SX_XLOCKED" .It Dv SX_LOCKED |