X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=urcu-bp.c;h=3af7c3b9712879b3b74481900b5ee615cae7f8e0;hb=79266051c59604c3923944d8003f8a9d2ad3c08b;hp=fc6eedf56a545dde91e1fa8b96456af5bc593158;hpb=2dfb8b5e30bc2d268bcbc57eceb9c54d21b36d90;p=urcu.git diff --git a/urcu-bp.c b/urcu-bp.c index fc6eedf..3af7c3b 100644 --- a/urcu-bp.c +++ b/urcu-bp.c @@ -122,7 +122,7 @@ void update_counter_and_wait(void) int wait_loops = 0; struct rcu_reader *index, *tmp; - /* Switch parity: 1 -> 0, 0 -> 1 */ + /* Switch parity: 0 -> 1, 1 -> 0 */ STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE); /* @@ -300,6 +300,7 @@ static void rcu_gc_registry(void) assert(ret != EINVAL); if (ret == ESRCH) { list_del(&rcu_reader_reg->head); + rcu_reader_reg->ctr = 0; rcu_reader_reg->alloc = 0; registry_arena.used -= sizeof(struct rcu_reader); }