about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-27 13:46:56 -0700
committerAndreas Schwab <schwab@redhat.com>2009-07-29 11:19:39 +0200
commit23d488f45e716ac4076d5b7d9394977bc6beb42a (patch)
treef2201e364741e8aad8e332fc5bfd76e5d5e7484b
parent07e2253d98c0136d9ad3f7ddd38ec1a2d7d2dc4e (diff)
downloadglibc-23d488f45e716ac4076d5b7d9394977bc6beb42a.tar.gz
glibc-23d488f45e716ac4076d5b7d9394977bc6beb42a.tar.xz
glibc-23d488f45e716ac4076d5b7d9394977bc6beb42a.zip
pthread_mutex_unlock needs to use _rel semantics for atomic ops.
(cherry picked from commit e73e694e38b7b222eec3ec5897eb507d88bb8928)
-rw-r--r--nptl/ChangeLog6
-rw-r--r--nptl/pthread_mutex_unlock.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index d97efa0cd2..2caceeb1d3 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -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-06-11  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #10262]
diff --git a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c
index 0028c5583f..fbe8274a55 100644
--- a/nptl/pthread_mutex_unlock.c
+++ b/nptl/pthread_mutex_unlock.c
@@ -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)