2.3.90-38

This commit is contained in:
Jakub Jelinek 2006-02-17 17:00:52 +00:00
parent 7cded629f3
commit 4779efd52d

View File

@ -1466,17 +1466,18 @@
static inline void __attribute__ ((always_inline)) static inline void __attribute__ ((always_inline))
__lll_mutex_unlock (int *futex) __lll_mutex_unlock (int *futex)
{ {
@@ -152,6 +201,16 @@ __lll_mutex_unlock (int *futex) @@ -152,6 +201,17 @@ __lll_mutex_unlock (int *futex)
static inline void __attribute__ ((always_inline)) static inline void __attribute__ ((always_inline))
+__lll_robust_mutex_unlock (int *futex) +__lll_robust_mutex_unlock (int *futex, int mask)
+{ +{
+ int val = atomic_exchange_rel (futex, 0); + int val = atomic_exchange_rel (futex, 0);
+ if (__builtin_expect (val & FUTEX_WAITERS, 0)) + if (__builtin_expect (val & mask, 0))
+ lll_futex_wake (futex, 1); + lll_futex_wake (futex, 1);
+} +}
+#define lll_robust_mutex_unlock(futex) __lll_robust_mutex_unlock(&(futex)) +#define lll_robust_mutex_unlock(futex) \
+ __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
+ +
+ +
+static inline void __attribute__ ((always_inline)) +static inline void __attribute__ ((always_inline))
@ -1866,17 +1867,17 @@
static inline void static inline void
__attribute__ ((always_inline)) __attribute__ ((always_inline))
+__lll_robust_mutex_unlock (int *futex) +__lll_robust_mutex_unlock (int *futex, int mask)
+{ +{
+ int oldval; + int oldval;
+ int newval = 0; + int newval = 0;
+ +
+ lll_compare_and_swap (futex, oldval, newval, "slr %2,%2"); + lll_compare_and_swap (futex, oldval, newval, "slr %2,%2");
+ if (oldval & FUTEX_WAITERS) + if (oldval & mask)
+ lll_futex_wake (futex, 1); + lll_futex_wake (futex, 1);
+} +}
+#define lll_robust_mutex_unlock(futex) \ +#define lll_robust_mutex_unlock(futex) \
+ __lll_robust_mutex_unlock(&(futex)) + __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
+ +
+ +
+static inline void +static inline void