epoch(9): update in_epoch() description as well

This commit is contained in:
Matt Macy 2018-07-04 03:54:39 +00:00
parent e533d7a330
commit 4619bce883
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335931

View File

@ -61,7 +61,7 @@
.Ft void
.Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback) (epoch_context_t)"
.Ft int
.Fn in_epoch "void"
.Fn in_epoch "epoch_t epoch"
.Sh DESCRIPTION
Epochs are used to guarantee liveness and immutability of data by
deferring reclamation and mutation until a grace period has elapsed.
@ -111,7 +111,7 @@ in the middle of an epoch section for the same epoch as this will lead to a dead
Be default mutexes cannot be held across
.Fn epoch_wait_preempt .
To permit this the epoch must be allocated with
.Fn EPOCH_LOCKED .
EPOCH_LOCKED.
When doing this one must be cautious of creating a situation where a deadlock is
possible. Note that epochs are not a straight replacement for read locks.
Callers must use safe list and tailq traversal routines in an epoch (see ck_queue).
@ -121,8 +121,8 @@ in place.
An item to be modified must be handled with copy on write
and frees must be deferred until after a grace period has elapsed.
.Sh RETURN VALUES
.Fn in_epoch
will return 1 if curthread is in an epoch, 0 otherwise.
.Fn in_epoch curepoch
will return 1 if curthread is in curepoch, 0 otherwise.
.Sh CAVEATS
One must be cautious when using
.Fn epoch_wait_preempt