]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd: Remove a too strict assert() statement
authorBart Van Assche <bvanassche@acm.org>
Fri, 29 Jul 2011 06:30:23 +0000 (06:30 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 29 Jul 2011 06:30:23 +0000 (06:30 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11937

drd/drd_pthread_intercepts.c

index b3fa771dfc56e74ae02ed85c90cad80948dd7cf9..856092fa6ee94f2a0ccabf5a715b966a97b85480 100644 (file)
@@ -196,12 +196,10 @@ static void DRD_(sema_down)(DrdSema* sema)
    while (sema->counter == 0) {
 #if defined(__linux__) && defined(__NR_futex)
       if (syscall(__NR_futex, (UWord)&sema->counter,
-                  FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0) == 0) {
+                  FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0) == 0)
          res = 0;
-      } else {
+      else
          res = errno;
-         assert(res == EWOULDBLOCK || res == ENOSYS);
-      }
 #endif
       /*
        * Invoke sched_yield() on non-Linux systems, if the futex syscall has
@@ -209,7 +207,7 @@ static void DRD_(sema_down)(DrdSema* sema)
        * where __NR_futex is defined and is run on a Linux system that does
        * not support the futex syscall.
        */
-      if (res == ENOSYS)
+      if (res != 0 && res != EWOULDBLOCK)
          sched_yield();
    }
    sema->counter--;