[BZ,#16892] Check value of futex before updating in __lll_timedlock
Commit Message
Retrying with git send-email. Patch unchanged other than whitespace fix.
2014-08-07 Bernard Ogden <bernie.ogden@linaro.org>
[BZ #16892]
* sysdeps/nptl/lowlevellock.h (__lll_timedlock): Use
atomic_compare_and_exchange_bool_acq rather than atomic_exchange_acq.
---
Comments
Thanks both for review. I'm not a committer - would someone commit for me?
On 12 August 2014 02:39, Roland McGrath <roland@hack.frob.com> wrote:
> Looks fine.
On 12 August 2014 08:53, Bernie Ogden <bernie.ogden@linaro.org> wrote:
> Thanks both for review. I'm not a committer - would someone commit for me?
>
> On 12 August 2014 02:39, Roland McGrath <roland@hack.frob.com> wrote:
>> Looks fine.
I'm happy to apply it but I'm not sure if it is allowable within the
terms of the freeze. Are we too late? This change fixes a regression
on MIPS at least.
On 12/08/14 18:08, Will Newton wrote:
> On 12 August 2014 08:53, Bernie Ogden <bernie.ogden@linaro.org> wrote:
>> Thanks both for review. I'm not a committer - would someone commit for me?
>>
>> On 12 August 2014 02:39, Roland McGrath <roland@hack.frob.com> wrote:
>>> Looks fine.
>
> I'm happy to apply it but I'm not sure if it is allowable within the
> terms of the freeze. Are we too late? This change fixes a regression
> on MIPS at least.
>
OK to apply.
Allan
On 12 August 2014 12:54, Allan McRae <allan@archlinux.org> wrote:
> On 12/08/14 18:08, Will Newton wrote:
>> On 12 August 2014 08:53, Bernie Ogden <bernie.ogden@linaro.org> wrote:
>>> Thanks both for review. I'm not a committer - would someone commit for me?
>>>
>>> On 12 August 2014 02:39, Roland McGrath <roland@hack.frob.com> wrote:
>>>> Looks fine.
>>
>> I'm happy to apply it but I'm not sure if it is allowable within the
>> terms of the freeze. Are we too late? This change fixes a regression
>> on MIPS at least.
>>
>
> OK to apply.
Thanks, pushed.
@@ -88,12 +88,15 @@ extern int __lll_timedlock_wait (int *futex, const struct timespec *,
extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
int private) attribute_hidden;
+/* Take futex if it is untaken.
+ Otherwise block until either we get the futex or abstime runs out. */
#define __lll_timedlock(futex, abstime, private) \
({ \
int *__futex = (futex); \
int __val = 0; \
\
- if (__glibc_unlikely (atomic_exchange_acq (__futex, 1))) \
+ if (__glibc_unlikely \
+ (atomic_compare_and_exchange_bool_acq (__futex, 1, 0))) \
__val = __lll_timedlock_wait (__futex, abstime, private); \
__val; \
})