From 8a9f29a35483855cf5cb42c54fb5e1d9e2e88afd Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 6 Sep 2012 12:24:07 -0400 Subject: [PATCH] ck_epoch: Add comment to clarify short-circuit logic. --- src/ck_epoch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ck_epoch.c b/src/ck_epoch.c index 4c14e05..9b6e721 100644 --- a/src/ck_epoch.c +++ b/src/ck_epoch.c @@ -330,11 +330,15 @@ ck_epoch_barrier(struct ck_epoch *global, struct ck_epoch_record *record) * function was called. */ while (cr = ck_epoch_scan(global, cr, delta), cr != NULL) { + ck_pr_stall(); + + /* + * If the epoch value was changed from underneath us then + * our epoch must have been observed at some point. + */ epoch = ck_pr_load_uint(&global->epoch); if (epoch != delta) break; - - ck_pr_stall(); } /*