ck_epoch_poll: make it safe to call ck_epoch_poll in a protected section.

This work is from jtl@FreeBSD.org. FreeBSD expects to call ck_epoch_poll
from a record that is in an active section. Previously, it was
considered an API violation to call write-side functions while in a read
section.

This is now permitted for poll as we we serialize behind the global
epoch counter.

Note that these functions are not reentrant. In the case of the
FreeBSD kernel, all these functions are called with preemption disabled.
awsm
Samy Al Bahra 6 years ago
parent 82d2958ef9
commit 4cb3067944

@ -589,10 +589,8 @@ ck_epoch_poll_deferred(struct ck_epoch_record *record, ck_stack_t *deferred)
n_dispatch = ck_epoch_dispatch(record, epoch - 2, deferred); n_dispatch = ck_epoch_dispatch(record, epoch - 2, deferred);
cr = ck_epoch_scan(global, cr, epoch, &active); cr = ck_epoch_scan(global, cr, epoch, &active);
if (cr != NULL) { if (cr != NULL)
record->epoch = epoch;
return (n_dispatch > 0); return (n_dispatch > 0);
}
/* We are at a grace period if all threads are inactive. */ /* We are at a grace period if all threads are inactive. */
if (active == false) { if (active == false) {

Loading…
Cancel
Save