ck_epoch: Remember to mark entry availability on unregister.

Pointed out by Matt Johnson (johnso87@crhc....>.
ck_pring
Samy Al Bahra 13 years ago
parent 56bd0b7424
commit 0c56b1b8c6

@ -147,7 +147,7 @@ ck_epoch_call(ck_epoch_t *epoch,
void ck_epoch_init(ck_epoch_t *); void ck_epoch_init(ck_epoch_t *);
ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *); ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *);
void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *); void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *);
void ck_epoch_unregister(ck_epoch_record_t *); void ck_epoch_unregister(ck_epoch_t *, ck_epoch_record_t *);
bool ck_epoch_poll(ck_epoch_t *, ck_epoch_record_t *); bool ck_epoch_poll(ck_epoch_t *, ck_epoch_record_t *);
void ck_epoch_synchronize(ck_epoch_t *, ck_epoch_record_t *); void ck_epoch_synchronize(ck_epoch_t *, ck_epoch_record_t *);
void ck_epoch_barrier(ck_epoch_t *, ck_epoch_record_t *); void ck_epoch_barrier(ck_epoch_t *, ck_epoch_record_t *);

@ -195,7 +195,7 @@ ck_epoch_register(struct ck_epoch *global, struct ck_epoch_record *record)
} }
void void
ck_epoch_unregister(struct ck_epoch_record *record) ck_epoch_unregister(struct ck_epoch *global, struct ck_epoch_record *record)
{ {
size_t i; size_t i;
@ -210,6 +210,7 @@ ck_epoch_unregister(struct ck_epoch_record *record)
ck_pr_fence_store(); ck_pr_fence_store();
ck_pr_store_uint(&record->state, CK_EPOCH_STATE_FREE); ck_pr_store_uint(&record->state, CK_EPOCH_STATE_FREE);
ck_pr_inc_uint(&global->n_free);
return; return;
} }

Loading…
Cancel
Save