From 0c56b1b8c6cff809d7fbe80cdf0671ccb68fff58 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Mon, 29 Oct 2012 18:03:23 -0400 Subject: [PATCH] ck_epoch: Remember to mark entry availability on unregister. Pointed out by Matt Johnson (johnso87@crhc....>. --- include/ck_epoch.h | 2 +- src/ck_epoch.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/ck_epoch.h b/include/ck_epoch.h index 1b7d1b5..dd2f998 100644 --- a/include/ck_epoch.h +++ b/include/ck_epoch.h @@ -147,7 +147,7 @@ ck_epoch_call(ck_epoch_t *epoch, void ck_epoch_init(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_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 *); void ck_epoch_synchronize(ck_epoch_t *, ck_epoch_record_t *); void ck_epoch_barrier(ck_epoch_t *, ck_epoch_record_t *); diff --git a/src/ck_epoch.c b/src/ck_epoch.c index 64426d9..29c60f5 100644 --- a/src/ck_epoch.c +++ b/src/ck_epoch.c @@ -195,7 +195,7 @@ ck_epoch_register(struct ck_epoch *global, struct ck_epoch_record *record) } void -ck_epoch_unregister(struct ck_epoch_record *record) +ck_epoch_unregister(struct ck_epoch *global, struct ck_epoch_record *record) { size_t i; @@ -210,6 +210,7 @@ ck_epoch_unregister(struct ck_epoch_record *record) ck_pr_fence_store(); ck_pr_store_uint(&record->state, CK_EPOCH_STATE_FREE); + ck_pr_inc_uint(&global->n_free); return; }