mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Revert "Memory ordering in pthread_mutex_{,timed}lock."
This reverts commit 7b7f43bed1
.
This commit is contained in:
@ -1,10 +1,3 @@
|
|||||||
2009-07-26 Ulrich Drepper <drepper@redhat.com>
|
|
||||||
|
|
||||||
[BZ #10418]
|
|
||||||
* pthread_mutex_lock.c (pthread_mutex_lock): Use _rel instead of of
|
|
||||||
_acq variants of cmpxchg.
|
|
||||||
* pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
|
|
||||||
|
|
||||||
2009-07-23 Ulrich Drepper <drepper@redhat.com>
|
2009-07-23 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* sysdeps/x86_64/configure.in: New file.
|
* sysdeps/x86_64/configure.in: New file.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
|
/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
newval
|
newval
|
||||||
= atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
newval, oldval);
|
newval, oldval);
|
||||||
|
|
||||||
if (newval != oldval)
|
if (newval != oldval)
|
||||||
@ -285,7 +285,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
|
|||||||
#ifdef NO_INCR
|
#ifdef NO_INCR
|
||||||
newval |= FUTEX_WAITERS;
|
newval |= FUTEX_WAITERS;
|
||||||
#endif
|
#endif
|
||||||
oldval = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
oldval = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
newval, 0);
|
newval, 0);
|
||||||
|
|
||||||
if (oldval != 0)
|
if (oldval != 0)
|
||||||
@ -420,7 +420,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
|
|||||||
oldprio = ceiling;
|
oldprio = ceiling;
|
||||||
|
|
||||||
oldval
|
oldval
|
||||||
= atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
#ifdef NO_INCR
|
#ifdef NO_INCR
|
||||||
ceilval | 2,
|
ceilval | 2,
|
||||||
#else
|
#else
|
||||||
@ -434,7 +434,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
oldval
|
oldval
|
||||||
= atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
ceilval | 2,
|
ceilval | 2,
|
||||||
ceilval | 1);
|
ceilval | 1);
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
|
|||||||
lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
|
lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
|
||||||
PTHREAD_MUTEX_PSHARED (mutex));
|
PTHREAD_MUTEX_PSHARED (mutex));
|
||||||
}
|
}
|
||||||
while (atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
ceilval | 2, ceilval)
|
ceilval | 2, ceilval)
|
||||||
!= ceilval);
|
!= ceilval);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
|
/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ pthread_mutex_timedlock (mutex, abstime)
|
|||||||
int newval = id | (oldval & FUTEX_WAITERS);
|
int newval = id | (oldval & FUTEX_WAITERS);
|
||||||
|
|
||||||
newval
|
newval
|
||||||
= atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
newval, oldval);
|
newval, oldval);
|
||||||
if (newval != oldval)
|
if (newval != oldval)
|
||||||
{
|
{
|
||||||
@ -246,7 +246,7 @@ pthread_mutex_timedlock (mutex, abstime)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oldval = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
oldval = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
id, 0);
|
id, 0);
|
||||||
|
|
||||||
if (oldval != 0)
|
if (oldval != 0)
|
||||||
@ -404,7 +404,7 @@ pthread_mutex_timedlock (mutex, abstime)
|
|||||||
oldprio = ceiling;
|
oldprio = ceiling;
|
||||||
|
|
||||||
oldval
|
oldval
|
||||||
= atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
ceilval | 1, ceilval);
|
ceilval | 1, ceilval);
|
||||||
|
|
||||||
if (oldval == ceilval)
|
if (oldval == ceilval)
|
||||||
@ -413,7 +413,7 @@ pthread_mutex_timedlock (mutex, abstime)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
oldval
|
oldval
|
||||||
= atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
ceilval | 2,
|
ceilval | 2,
|
||||||
ceilval | 1);
|
ceilval | 1);
|
||||||
|
|
||||||
@ -456,7 +456,7 @@ pthread_mutex_timedlock (mutex, abstime)
|
|||||||
PTHREAD_MUTEX_PSHARED (mutex));
|
PTHREAD_MUTEX_PSHARED (mutex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
|
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
ceilval | 2, ceilval)
|
ceilval | 2, ceilval)
|
||||||
!= ceilval);
|
!= ceilval);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user