MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ck_epoch_call

Function ck_epoch_call

freebsd/contrib/ck/include/ck_epoch.h:195–208  ·  view source on GitHub ↗

* Defers the execution of the function pointed to by the "cb" * argument until an epoch counter loop. This allows for a * non-blocking deferral. * * We can get away without a fence here due to the monotonic nature * of the epoch counter. Worst case, this will result in some delays * before object destruction. */

Source from the content-addressed store, hash-verified

193 * before object destruction.
194 */
195CK_CC_FORCE_INLINE static void
196ck_epoch_call(ck_epoch_record_t *record,
197 ck_epoch_entry_t *entry,
198 ck_epoch_cb_t *function)
199{
200 struct ck_epoch *epoch = record->global;
201 unsigned int e = ck_pr_load_uint(&epoch->epoch);
202 unsigned int offset = e & (CK_EPOCH_LENGTH - 1);
203
204 record->n_pending++;
205 entry->function = function;
206 ck_stack_push_spnc(&record->pending[offset], &entry->stack_entry);
207 return;
208}
209
210/*
211 * Same as ck_epoch_call, but allows for records to be shared and is reentrant.

Callers 1

epoch_callFunction · 0.85

Calls 1

ck_stack_push_spncFunction · 0.85

Tested by

no test coverage detected