diff -u linux-2.6.13.2/kernel/futex.c linux-2.6.13.3/kernel/futex.c --- linux-2.6.13.2/kernel/futex.c +++ linux-2.6.13.3/kernel/futex.c @@ -746,11 +746,6 @@ * the futex is not locked. */ -#define FUTEX_WAITERS 0x80000000 -#define FUTEX_OWNER_DIED 0x40000000 -#define FUTEX_NOT_RECOVERABLE 0x20000000 -#define FUTEX_PID 0x1fffffff - /* * Used to track registered robust futexes. Attached to linked list in inodes. */ @@ -1071,16 +1066,6 @@ goto out_release_sem; } - /* - * user mode called us because futex had owner and waitflag was - * set. That's not true now, so let user mode try again - */ - if ((curval & FUTEX_PID) && !(curval & FUTEX_WAITERS)) { - ret = -EAGAIN; - queue_unlock(&q, bh); - goto out_release_sem; - } - /* if owner has died, we don't want to wait */ if ((curval & FUTEX_OWNER_DIED)) { ret = -EOWNERDEAD; diff -u linux-2.6.13.2/include/linux/futex.h linux-2.6.13.3/include/linux/futex.h --- linux-2.6.13.2/include/linux/futex.h +++ linux-2.6.13.3/include/linux/futex.h @@ -1,8 +1,6 @@ #ifndef _LINUX_FUTEX_H #define _LINUX_FUTEX_H -#include - /* Second argument to futex syscall */ @@ -18,8 +16,18 @@ #define FUTEX_DEREGISTER (9) #define FUTEX_RECOVER (10) -#define MUTEX_PRIORITY_QUEUING 0x10000000 -#define MUTEX_PRIORITY_INHERITANCE 0x20000000 +#define FUTEX_ATTR_PRIORITY_QUEUING 0x10000000 +#define FUTEX_ATTR_PRIORITY_INHERITANCE 0x20000000 +#define FUTEX_ATTR_PRIORITY_PROTECT 0x40000000 +#define FUTEX_ATTR_ROBUST 0x80000000 +#define FUTEX_ATTR_SHARED 0x01000000 +#define FUTEX_ATTR_MASK 0xff000000 + +#define FUTEX_WAITERS 0x80000000 +#define FUTEX_OWNER_DIED 0x40000000 +#define FUTEX_NOT_RECOVERABLE 0x20000000 +#define FUTEX_FLAGS (FUTEX_WAITERS | FUTEX_OWNER_DIED | FUTEX_NOT_RECOVERABLE) +#define FUTEX_PID ~(FUTEX_FLAGS) #ifdef __KERNEL__