]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
pthread_mutex_unlock needs to use _rel semantics for atomic ops.
authorUlrich Drepper <drepper@redhat.com>
Mon, 27 Jul 2009 20:46:56 +0000 (13:46 -0700)
committerUlrich Drepper <drepper@redhat.com>
Mon, 27 Jul 2009 20:46:56 +0000 (13:46 -0700)
nptl/ChangeLog
nptl/pthread_mutex_unlock.c

index cb9ec53cd1bbcf72edc9b28b10efb37dc0175062..8dd93732b5fd0f7cf13d9535f56a6a3f17c87964 100644 (file)
@@ -1,3 +1,9 @@
+2009-07-27  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #10418]
+       * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
+       instead of of _acq variants of cmpxchg.
+
 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/x86_64/configure.in: New file.
index 0028c5583f287c54b8136f04956296b164089128..fbe8274a559499e4339b6d22e22be04387c892b1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005-2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005-2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -213,7 +213,7 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr)
 
       /* Unlock.  */
       if ((mutex->__data.__lock & FUTEX_WAITERS) != 0
-         || atomic_compare_and_exchange_bool_acq (&mutex->__data.__lock, 0,
+         || atomic_compare_and_exchange_bool_rel (&mutex->__data.__lock, 0,
                                                   THREAD_GETMEM (THREAD_SELF,
                                                                  tid)))
        {
@@ -263,7 +263,7 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr)
          oldval = mutex->__data.__lock;
          newval = oldval & PTHREAD_MUTEX_PRIO_CEILING_MASK;
        }
-      while (atomic_compare_and_exchange_bool_acq (&mutex->__data.__lock,
+      while (atomic_compare_and_exchange_bool_rel (&mutex->__data.__lock,
                                                   newval, oldval));
 
       if ((oldval & ~PTHREAD_MUTEX_PRIO_CEILING_MASK) > 1)