Skip to content

Commit 381cb8c

Browse files
authored
Merge pull request #13 from linD026/master
Fix grace period over bound checking
2 parents 23c2dbb + 68b2f1a commit 381cb8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

thread-rcu/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void *reader_func(void *argv)
7171
if (tmp->count != old_prev_count)
7272
atomic_fetch_add_explicit(&gp_idx, 1, memory_order_release);
7373
if (atomic_load_explicit(&gp_idx, memory_order_acquire) >
74-
N_UPDATE_RUN + 1) {
74+
N_UPDATE_RUN) {
7575
fprintf(stderr, "grace period index (%u) is over bound (%u).\n",
7676
atomic_load_explicit(&gp_idx, memory_order_acquire),
7777
N_UPDATE_RUN);

0 commit comments

Comments
 (0)