Fix: compat_futex should work-around futex signal-restart kernel bug
[urcu.git] / compat_futex.c
index 0cc2956b66bcf35a5fe0786844e9d133743e6690..9e918fe8e2aac035dc39e6e23868410348d02627 100644 (file)
@@ -54,11 +54,11 @@ pthread_cond_t __urcu_compat_futex_cond = PTHREAD_COND_INITIALIZER;
 int compat_futex_noasync(int32_t *uaddr, int op, int32_t val,
        const struct timespec *timeout, int32_t *uaddr2, int32_t val3)
 {
 int compat_futex_noasync(int32_t *uaddr, int op, int32_t val,
        const struct timespec *timeout, int32_t *uaddr2, int32_t val3)
 {
-       int ret, lockret;
+       int ret = 0, lockret;
 
        /*
         * Check if NULL. Don't let users expect that they are taken into
 
        /*
         * Check if NULL. Don't let users expect that they are taken into
-        * account. 
+        * account.
         */
        assert(!timeout);
        assert(!uaddr2);
         */
        assert(!timeout);
        assert(!uaddr2);
@@ -111,6 +111,8 @@ end:
  * _ASYNC SIGNAL-SAFE_.
  * For now, timeout, uaddr2 and val3 are unused.
  * Waiter will busy-loop trying to read the condition.
  * _ASYNC SIGNAL-SAFE_.
  * For now, timeout, uaddr2 and val3 are unused.
  * Waiter will busy-loop trying to read the condition.
+ * It is OK to use compat_futex_async() on a futex address on which
+ * futex() WAKE operations are also performed.
  */
 
 int compat_futex_async(int32_t *uaddr, int op, int32_t val,
  */
 
 int compat_futex_async(int32_t *uaddr, int op, int32_t val,
@@ -120,7 +122,7 @@ int compat_futex_async(int32_t *uaddr, int op, int32_t val,
 
        /*
         * Check if NULL. Don't let users expect that they are taken into
 
        /*
         * Check if NULL. Don't let users expect that they are taken into
-        * account. 
+        * account.
         */
        assert(!timeout);
        assert(!uaddr2);
         */
        assert(!timeout);
        assert(!uaddr2);
This page took 0.029612 seconds and 4 git commands to generate.