Version 0.8.11
[userspace-rcu.git] / urcu-qsbr.c
index b01294accd3fd0cdb3bbe5934b5cff582b4eabf0..428e9251c0b75f654c8ecd2a7f2edb0645d4839e 100644 (file)
@@ -126,9 +126,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);
+               }
+       }
 }
 
 /*
This page took 0.023206 seconds and 4 git commands to generate.