X-Git-Url: http://git.liburcu.org/?p=userspace-rcu.git;a=blobdiff_plain;f=urcu.c;h=c5abeafa06d3bd796a2148a1effdf90c2c959dd1;hp=1d4bf7afb04030155f7cb88d4dcb2cf8e2518a66;hb=7a3e2ed26a6be1deac2cfde1d062526497d4ae9f;hpb=ed42f6768d2116c47ca9ef2c17927a45f6b98f04 diff --git a/urcu.c b/urcu.c index 1d4bf7a..c5abeaf 100644 --- a/urcu.c +++ b/urcu.c @@ -224,9 +224,22 @@ static void wait_gp(void) { /* Read reader_gp before read futex */ smp_mb_master(RCU_MB_GROUP); - if (uatomic_read(&gp_futex) == -1) - futex_async(&gp_futex, FUTEX_WAIT, -1, - NULL, NULL, 0); + if (uatomic_read(&gp_futex) != -1) + return; + while (futex_async(&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); + } + } } /*