]> sourceware.org Git - glibc.git/commitdiff
nptl: handle EAGAIN with some futex operations
authorCarlos O'Donell <carlos@systemhalted.org>
Fri, 16 Aug 2013 19:00:53 +0000 (15:00 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 8 Feb 2014 14:21:15 +0000 (09:21 -0500)
https://bugs.gentoo.org/452184

nptl/pthread_mutex_trylock.c
nptl/sysdeps/unix/sysv/linux/sem_timedwait.c
nptl/sysdeps/unix/sysv/linux/sem_wait.c

index 4d5f75d24f88e0696ba2339a3f74376325c5f21d..4bf19ec9cc5607c4057e48e80a8c0fd75384c90d 100644 (file)
@@ -260,7 +260,8 @@ __pthread_mutex_trylock (mutex)
                                                          private), 0, 0);
 
            if (INTERNAL_SYSCALL_ERROR_P (e, __err)
-               && INTERNAL_SYSCALL_ERRNO (e, __err) == EWOULDBLOCK)
+               && ((INTERNAL_SYSCALL_ERRNO (e, __err) == EWOULDBLOCK)
+                   || (INTERNAL_SYSCALL_ERRNO (e, __err) == EAGAIN)))
              {
                THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
 
index 7dfe51dd8bea871a81c4aa353563e6d19f5d7b5e..f96f6251e214845a0aafa2f4775a46d8e8141a24 100644 (file)
@@ -94,7 +94,7 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime)
       rt.tv_sec = sec;
       rt.tv_nsec = nsec;
       err = do_futex_timed_wait(isem, &rt);
-      if (err != 0 && err != -EWOULDBLOCK)
+      if (err != 0 && err != -EWOULDBLOCK && err != -EAGAIN)
        {
          __set_errno (-err);
          err = -1;
index 7d586cf186f6734e7d8b39f427e5bda637191e88..6f2a89fd16af17a224c3323955a9f416f2b21432 100644 (file)
@@ -67,7 +67,7 @@ __new_sem_wait (sem_t *sem)
   while (1)
     {
       err = do_futex_wait(isem);
-      if (err != 0 && err != -EWOULDBLOCK)
+      if (err != 0 && err != -EWOULDBLOCK && err != -EAGAIN)
        {
          __set_errno (-err);
          err = -1;
@@ -112,7 +112,7 @@ __old_sem_wait (sem_t *sem)
       /* Disable asynchronous cancellation.  */
       __pthread_disable_asynccancel (oldtype);
     }
-  while (err == 0 || err == -EWOULDBLOCK);
+  while (err == 0 || err == -EWOULDBLOCK || err == -EAGAIN);
 
   __set_errno (-err);
   return -1;
This page took 0.049431 seconds and 5 git commands to generate.