olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh841653-10.patch

00db10
commit b0a3c1640ab2fb7d16d9b9a8d9c0e524e9cb0001
00db10
Author: Andreas Schwab <schwab@suse.de>
00db10
Date:   Tue Mar 4 13:00:26 2014 +0100
00db10
00db10
    Properly handle forced elision in pthread_mutex_trylock (bug 16657)
00db10
00db10
Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/pthread_mutex_trylock.c
00db10
+++ glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c
00db10
@@ -26,8 +26,8 @@
00db10
 #define lll_trylock_elision(a,t) lll_trylock(a)
00db10
 #endif
00db10
 
00db10
-#ifndef DO_ELISION
00db10
-#define DO_ELISION(m) 0
00db10
+#ifndef FORCE_ELISION
00db10
+#define FORCE_ELISION(m, s)
00db10
 #endif
00db10
 
00db10
 /* We don't force elision in trylock, because this can lead to inconsistent
00db10
@@ -69,7 +69,7 @@ __pthread_mutex_trylock (mutex)
00db10
       break;
00db10
 
00db10
     case PTHREAD_MUTEX_TIMED_ELISION_NP:
00db10
-    elision:
00db10
+    elision: __attribute__((unused))
00db10
       if (lll_trylock_elision (mutex->__data.__lock,
00db10
 			       mutex->__data.__elision) != 0)
00db10
         break;
00db10
@@ -77,8 +77,7 @@ __pthread_mutex_trylock (mutex)
00db10
       return 0;
00db10
 
00db10
     case PTHREAD_MUTEX_TIMED_NP:
00db10
-      if (DO_ELISION (mutex))
00db10
-	goto elision;
00db10
+      FORCE_ELISION (mutex, goto elision);
00db10
       /*FALL THROUGH*/
00db10
     case PTHREAD_MUTEX_ADAPTIVE_NP:
00db10
     case PTHREAD_MUTEX_ERRORCHECK_NP:
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h
00db10
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h
00db10
@@ -16,11 +16,6 @@
00db10
    License along with the GNU C Library; if not, see
00db10
    <http://www.gnu.org/licenses/>.  */
00db10
 
00db10
-/* Check for elision on this lock without upgrading.  */
00db10
-#define DO_ELISION(m)							\
00db10
-  (__pthread_force_elision						\
00db10
-   && (m->__data.__kind & PTHREAD_MUTEX_NO_ELISION_NP) == 0)		\
00db10
-
00db10
 /* Automatically enable elision for existing user lock kinds.  */
00db10
 #define FORCE_ELISION(m, s)						\
00db10
   if (__pthread_force_elision						\