|
NAME
LIBRARYConcurrency Kit (libck, -lck) SYNOPSIS
ck_epoch_record_t *
DESCRIPTIONThe
EXAMPLE#include <ck_epoch.h>
#include <stdlib.h>
/*
* epoch was previously initialized with ck_epoch_init.
*/
ck_epoch_t *epoch;
void
function(void)
{
ck_epoch_record_t *record;
record = ck_epoch_recycle(&epoch);
if (record == NULL) {
record = malloc(sizeof *record);
if (record == NULL)
return;
ck_epoch_register(&epoch, record, NULL);
}
/*
* After we are done, we will unregister the record so it
* can be used by other new participants in the epoch system
* provided by the object pointed to by "epoch".
*/
ck_epoch_unregister(&epoch, record);
return;
}
RETURN VALUESThis function returns a pointer to a
ERRORSBehavior is undefined if the object pointed to by epoch is not a valid epoch object. SEE ALSOck_epoch_init(3), ck_epoch_register(3), ck_epoch_unregister(3), ck_epoch_poll(3), ck_epoch_synchronize(3), ck_epoch_reclaim(3), ck_epoch_barrier(3), ck_epoch_call(3), ck_epoch_begin(3), ck_epoch_end(3) Additional information available at http://concurrencykit.org/
|