From 13dd1a4f82ff651a49452e17cc8ef690dea0fba5 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sat, 2 Apr 2011 12:32:17 -0400 Subject: [PATCH] ck_epoch: Update reader-side. --- include/ck_epoch.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ck_epoch.h b/include/ck_epoch.h index f332048..241c454 100644 --- a/include/ck_epoch.h +++ b/include/ck_epoch.h @@ -243,8 +243,9 @@ ck_epoch_write_begin(struct ck_epoch_record *record) CK_CC_INLINE static void ck_epoch_read_begin(struct ck_epoch_record *record) { - unsigned int g_epoch = ck_pr_load_uint(&global->epoch) & (CK_EPOCH_LENGTH - 1); + unsigned int g_epoch = ck_pr_load_uint(&record->global->epoch); + g_epoch &= CK_EPOCH_LENGTH - 1; ck_pr_store_uint(&record->epoch, g_epoch); ck_pr_store_uint(&record->active, 1); ck_pr_fence_store();