|
From: <sv...@va...> - 2011-07-29 06:35:11
|
Author: bart
Date: 2011-07-29 07:30:23 +0100 (Fri, 29 Jul 2011)
New Revision: 11937
Log:
drd: Remove a too strict assert() statement
Modified:
trunk/drd/drd_pthread_intercepts.c
Modified: trunk/drd/drd_pthread_intercepts.c
===================================================================
--- trunk/drd/drd_pthread_intercepts.c 2011-07-29 06:12:51 UTC (rev 11936)
+++ trunk/drd/drd_pthread_intercepts.c 2011-07-29 06:30:23 UTC (rev 11937)
@@ -196,12 +196,10 @@
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 @@
* 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--;
|