X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=urcu-qsbr.c;fp=urcu-qsbr.c;h=619df60511b67ce9f5408d13e5ef33f7326ee7f5;hp=685efb5297dca06632697d810f5f078bc0aa835d;hb=b0a841b4ff807dd29fe0cdbfe24900312f0e627b;hpb=f4fe930941ad7e73ca2064c8be1abc31626ec50b diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 685efb5..619df60 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -121,9 +121,22 @@ static void wait_gp(void) { /* Read reader_gp before read futex */ cmm_smp_rmb(); - if (uatomic_read(&rcu_gp.futex) == -1) - futex_noasync(&rcu_gp.futex, FUTEX_WAIT, -1, - NULL, NULL, 0); + if (uatomic_read(&rcu_gp.futex) != -1) + return; + while (futex_noasync(&rcu_gp.futex, FUTEX_WAIT, -1, + NULL, NULL, 0)) { + switch (errno) { + case EWOULDBLOCK: + /* Value already changed. */ + return; + case EINTR: + /* Retry if interrupted by signal. */ + break; /* Get out of switch. */ + default: + /* Unexpected error. */ + urcu_die(errno); + } + } } /*