X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-qsbr.c;h=a2cabb446afda2db312b6d42a00b8ea5f02a4769;hb=6488f70bcf96976bfda4d1836e0cab5ef6f599ff;hp=ec483d925c0bdbfc85e8a0dfeb1690849a940705;hpb=1745be1a65fcf0398247b03ed30efeeeba52482a;p=userspace-rcu.git diff --git a/urcu-qsbr.c b/urcu-qsbr.c index ec483d9..a2cabb4 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -119,7 +119,7 @@ static void wait_gp(void) static void update_counter_and_wait(void) { CDS_LIST_HEAD(qsreaders); - int wait_loops = 0; + unsigned int wait_loops = 0; struct rcu_reader *index, *tmp; #if (CAA_BITS_PER_LONG < 64) @@ -150,7 +150,8 @@ static void update_counter_and_wait(void) * Wait for each thread rcu_reader_qs_gp count to become 0. */ for (;;) { - wait_loops++; + if (wait_loops < RCU_QS_ACTIVE_ATTEMPTS) + wait_loops++; if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { uatomic_set(&gp_futex, -1); /*