ck_epoch: add epoch_value to return current global epoch.

ck_pring
Samy Al Bahra 8 years ago
parent 8391338299
commit 6a9da5c91d

@ -234,6 +234,17 @@ ck_epoch_call_strict(ck_epoch_record_t *record,
typedef void ck_epoch_wait_cb_t(ck_epoch_t *, ck_epoch_record_t *, typedef void ck_epoch_wait_cb_t(ck_epoch_t *, ck_epoch_record_t *,
void *); void *);
/*
* Return latest epoch value. This operation provides load ordering.
*/
CK_CC_FORCE_INLINE static unsigned int
ck_epoch_value(const ck_epoch_t *ep)
{
ck_pr_fence_load();
return ck_pr_load_uint(&ep->epoch);
}
void ck_epoch_init(ck_epoch_t *); void ck_epoch_init(ck_epoch_t *);
/* /*

Loading…
Cancel
Save