summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Murphy <murphyp@linux.vnet.ibm.com>2015-09-03 13:40:11 -0500
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2015-10-15 18:55:48 -0300
commite5e6bea22a2939fe7c415a375992f3ca19f9ff2e (patch)
tree020b80fd6849e58a1ad7fec2c305fa75be4d3fbf
parent3c82bb5042330441a18fd8e8d5b74d25d5540a66 (diff)
downloadglibc-e5e6bea22a2939fe7c415a375992f3ca19f9ff2e.tar.gz
glibc-e5e6bea22a2939fe7c415a375992f3ca19f9ff2e.tar.xz
glibc-e5e6bea22a2939fe7c415a375992f3ca19f9ff2e.zip
nptl: Add adapt_count parameter to lll_unlock_elision
Adding this parameter will give architectures more freedom in
how they choose to update this variable.  This change has no
effect on architectures which choose not to use it.

	* nptl/pthread_mutex_unlock.c(lll_unlock_elision):
	Add elision adapt_count parameter to list of arguments.
	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
	(lll_unlock_elision): Update with new parameter list
	* sysdeps/unix/sysv/linux/s390/lowlevellock.h
	(lll_unlock_elision): Likewise
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
	(lll_unlock_elision): Likewise
-rw-r--r--ChangeLog11
-rw-r--r--nptl/pthread_mutex_unlock.c4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/lowlevellock.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/lowlevellock.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/lowlevellock.h2
5 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 0261e66b16..6a743e454b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-10-15  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+
+	* nptl/pthread_mutex_unlock.c (lll_unlock_elision):
+	Add elision adapt_count parameter to list of arguments.
+	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+	(lll_unlock_elision): Update with new parameter list
+	* sysdeps/unix/sysv/linux/s390/lowlevellock.h
+	(lll_unlock_elision): Likewise
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+	(lll_unlock_elision): Likewise
+
 2015-10-15  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #19122]
diff --git a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c
index 80939ba8b0..9e864c1832 100644
--- a/nptl/pthread_mutex_unlock.c
+++ b/nptl/pthread_mutex_unlock.c
@@ -24,7 +24,7 @@
 #include <stap-probe.h>
 
 #ifndef lll_unlock_elision
-#define lll_unlock_elision(a,b) ({ lll_unlock (a,b); 0; })
+#define lll_unlock_elision(a,b,c) ({ lll_unlock (a,c); 0; })
 #endif
 
 static int
@@ -63,7 +63,7 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
   else if (__glibc_likely (type == PTHREAD_MUTEX_TIMED_ELISION_NP))
     {
       /* Don't reset the owner/users fields for elision.  */
-      return lll_unlock_elision (mutex->__data.__lock,
+      return lll_unlock_elision (mutex->__data.__lock, mutex->__data.__elision,
 				      PTHREAD_MUTEX_PSHARED (mutex));
     }
   else if (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex)
diff --git a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
index 67db1dece2..16479e7753 100644
--- a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
@@ -40,7 +40,7 @@ extern int __lll_trylock_elision(int *lock, short *adapt_count)
 
 #define lll_lock_elision(futex, adapt_count, private) \
   __lll_lock_elision (&(futex), &(adapt_count), private)
-#define lll_unlock_elision(futex, private) \
+#define lll_unlock_elision(futex, adapt_count, private) \
   __lll_unlock_elision (&(futex), private)
 #define lll_trylock_elision(futex, adapt_count) \
   __lll_trylock_elision (&(futex), &(adapt_count))
diff --git a/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index 163a731bd3..cab5f4c7a3 100644
--- a/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -41,7 +41,7 @@ extern int __lll_trylock_elision(int *futex, short *adapt_count)
 
 #  define lll_lock_elision(futex, adapt_count, private) \
   __lll_lock_elision (&(futex), &(adapt_count), private)
-#  define lll_unlock_elision(futex, private) \
+#  define lll_unlock_elision(futex, adapt_count, private) \
   __lll_unlock_elision (&(futex), private)
 #  define lll_trylock_elision(futex, adapt_count) \
   __lll_trylock_elision(&(futex), &(adapt_count))
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index de525cd4c7..1fbd31e1fa 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -342,7 +342,7 @@ extern int __lll_trylock_elision (int *lock, short *adapt_count)
 
 #define lll_lock_elision(futex, adapt_count, private) \
   __lll_lock_elision (&(futex), &(adapt_count), private)
-#define lll_unlock_elision(futex, private) \
+#define lll_unlock_elision(futex, adapt_count, private) \
   __lll_unlock_elision (&(futex), private)
 #define lll_trylock_elision(futex, adapt_count) \
   __lll_trylock_elision (&(futex), &(adapt_count))