doc/ck_epoch: Update documentation for epoch sections.

ck_pring
Samy Al Bahra 9 years ago
parent 2e75aefc4a
commit 357324dd3e

@ -34,7 +34,7 @@ Concurrency Kit (libck, \-lck)
.Sh SYNOPSIS .Sh SYNOPSIS
.In ck_epoch.h .In ck_epoch.h
.Ft void .Ft void
.Fn ck_epoch_barrier "ck_epoch_t *epoch" "ck_epoch_record_t *record" .Fn ck_epoch_barrier "ck_epoch_record_t *record"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn ck_epoch_barrier 3 .Fn ck_epoch_barrier 3
@ -77,19 +77,19 @@ function(void)
* If there was only one thread popping from the this stack, * If there was only one thread popping from the this stack,
* then there is no need to ck_epoch_begin/ck_epoch_end. * then there is no need to ck_epoch_begin/ck_epoch_end.
*/ */
ck_epoch_begin(epoch, record); ck_epoch_begin(record);
/* Logically delete an object. */ /* Logically delete an object. */
s = ck_stack_pop_upmc(stack); s = ck_stack_pop_upmc(stack);
ck_epoch_end(epoch, record); ck_epoch_end(record);
/* /*
* Wait until no threads could possibly have a reference to the * Wait until no threads could possibly have a reference to the
* object we just popped (assume all threads are simply executing * object we just popped (assume all threads are simply executing
* ck_stack_pop_upmc). * ck_stack_pop_upmc).
*/ */
ck_epoch_barrier(epoch, record); ck_epoch_barrier(record);
/* It is now safe to physically delete the object. */ /* It is now safe to physically delete the object. */
free(s); free(s);

@ -34,7 +34,7 @@ Concurrency Kit (libck, \-lck)
.Sh SYNOPSIS .Sh SYNOPSIS
.In ck_epoch.h .In ck_epoch.h
.Ft void .Ft void
.Fn ck_epoch_begin "ck_epoch_t *epoch" "ck_epoch_record_t *record" .Fn ck_epoch_begin "ck_epoch_record_t *record" "ck_epoch_section_t *section"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn ck_epoch_begin 3 .Fn ck_epoch_begin 3
@ -44,7 +44,9 @@ An epoch-protected code section is delimited by a call to the
function. Though recursion is allowed for epoch-protected sections, function. Though recursion is allowed for epoch-protected sections,
recursive calls will be associated with the recursive calls will be associated with the
.Fn ck_epoch_begin 3 .Fn ck_epoch_begin 3
that is at the top of the call stack. that is at the top of the call stack. If a section is passed, then
recursion on a record will cause the epoch to be refreshed on entry
of every protected section.
.Sh RETURN VALUES .Sh RETURN VALUES
This function has no return value. This function has no return value.
.Sh ERRORS .Sh ERRORS

@ -37,7 +37,7 @@ typedef struct ck_epoch_entry ck_epoch_entry_t;
.br .br
typedef void ck_epoch_cb_t(ck_epoch_entry_t *); typedef void ck_epoch_cb_t(ck_epoch_entry_t *);
.Ft void .Ft void
.Fn ck_epoch_call "ck_epoch_t *epoch" "ck_epoch_record_t *record" "ck_epoch_entry_t *entry" "ck_epoch_cb_t *function" .Fn ck_epoch_call "ck_epoch_record_t *record" "ck_epoch_entry_t *entry" "ck_epoch_cb_t *function"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn ck_epoch_call 3 .Fn ck_epoch_call 3
@ -102,15 +102,15 @@ function(void)
* writers. It is also an option to use other forms of blocking * writers. It is also an option to use other forms of blocking
* write-side synchronization such as mutexes. * write-side synchronization such as mutexes.
*/ */
ck_epoch_begin(epoch, record); ck_epoch_begin(record);
n = ck_pr_fas_ptr(&global, n); n = ck_pr_fas_ptr(&global, n);
ck_epoch_end(epoch, record); ck_epoch_end(record);
/* Defer destruction of previous object. */ /* Defer destruction of previous object. */
ck_epoch_call(record, &n->epoch_entry, destroy_object); ck_epoch_call(record, &n->epoch_entry, destroy_object);
/* Poll epoch sub-system in non-blocking manner. */ /* Poll epoch sub-system in non-blocking manner. */
ck_epoch_poll(&epoch, record); ck_epoch_poll(record);
return; return;
} }
.Ed .Ed

@ -34,19 +34,18 @@ Concurrency Kit (libck, \-lck)
.Sh SYNOPSIS .Sh SYNOPSIS
.In ck_epoch.h .In ck_epoch.h
.Ft void .Ft void
.Fn ck_epoch_end "ck_epoch_t *epoch" "ck_epoch_record_t *record" .Fn ck_epoch_end "ck_epoch_record_t *record" "ck_epoch_section_t *section"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn ck_epoch_end 3 .Fn ck_epoch_end 3
function will mark the end of an epoch-protected code section. function will mark the end of an epoch-protected code section.
.Fa section
must point to a section object initialized previously with
.Fn ck_epoch_begin 3 .
.Sh RETURN VALUES .Sh RETURN VALUES
This function has no return value. This function has no return value.
.Sh ERRORS .Sh ERRORS
The object pointed to by The object pointed to by
.Fa epoch
must have been previously initiated via
.Fn ck_epoch_init 3 .
The object pointed to by
.Fa record .Fa record
must have been previously registered via must have been previously registered via
.Fn ck_epoch_register 3 . .Fn ck_epoch_register 3 .

@ -34,7 +34,7 @@ Concurrency Kit (libck, \-lck)
.Sh SYNOPSIS .Sh SYNOPSIS
.In ck_epoch.h .In ck_epoch.h
.Ft void .Ft void
.Fn ck_epoch_synchronize "ck_epoch_t *epoch" "ck_epoch_record_t *record" .Fn ck_epoch_synchronize "ck_epoch_record_t *record"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn ck_epoch_synchronize 3 .Fn ck_epoch_synchronize 3
@ -80,19 +80,19 @@ function(void)
* If there was only one thread popping from the this stack, * If there was only one thread popping from the this stack,
* then there is no need to ck_epoch_begin/ck_epoch_end. * then there is no need to ck_epoch_begin/ck_epoch_end.
*/ */
ck_epoch_begin(epoch, record); ck_epoch_begin(record);
/* Logically delete an object. */ /* Logically delete an object. */
s = ck_stack_pop_upmc(stack); s = ck_stack_pop_upmc(stack);
ck_epoch_end(epoch, record); ck_epoch_end(record);
/* /*
* Wait until no threads could possibly have a reference to the * Wait until no threads could possibly have a reference to the
* object we just popped (assume all threads are simply executing * object we just popped (assume all threads are simply executing
* ck_stack_pop_upmc). * ck_stack_pop_upmc).
*/ */
ck_epoch_synchronize(epoch, record); ck_epoch_synchronize(record);
/* It is now safe to physically delete the object. */ /* It is now safe to physically delete the object. */
free(s); free(s);
@ -102,11 +102,7 @@ function(void)
.Sh RETURN VALUES .Sh RETURN VALUES
This function has no return value. This function has no return value.
.Sh ERRORS .Sh ERRORS
Behavior is undefined if the object pointed to by The object pointed to by .Fa record must have been previously registered via
.Fa epoch
is not a valid epoch object. The object pointed to by
.Fa record
must have been previously registered via
.Fn ck_epoch_register 3 . .Fn ck_epoch_register 3 .
.Sh SEE ALSO .Sh SEE ALSO
.Xr ck_epoch_init 3 , .Xr ck_epoch_init 3 ,

@ -34,7 +34,7 @@ Concurrency Kit (libck, \-lck)
.Sh SYNOPSIS .Sh SYNOPSIS
.In ck_epoch.h .In ck_epoch.h
.Ft void .Ft void
.Fn ck_epoch_unregister "ck_epoch_t *epoch" "ck_epoch_record_t *record" .Fn ck_epoch_unregister "ck_epoch_record_t *record"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn ck_epoch_unregister 3 .Fn ck_epoch_unregister 3
@ -50,14 +50,6 @@ is modified in any way, even after a call is made to the
function. function.
.Sh RETURN VALUES .Sh RETURN VALUES
This function has no return value. This function has no return value.
.Sh ERRORS
Behavior is undefined if the object pointed to by
.Fa record
was not previously associated with the object pointed to by
.Fa epoch
through a previous call to the
.Fn ck_epoch_register 3
function.
.Sh SEE ALSO .Sh SEE ALSO
.Xr ck_epoch_init 3 , .Xr ck_epoch_init 3 ,
.Xr ck_epoch_register 3 , .Xr ck_epoch_register 3 ,

Loading…
Cancel
Save