about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2014-03-04 13:00:26 +0100
committerAndreas Schwab <schwab@suse.de>2014-12-11 12:44:27 +0100
commitb0a3c1640ab2fb7d16d9b9a8d9c0e524e9cb0001 (patch)
tree3e3d5fbf0d33c32e0219d27089b0491b3be42466 /nptl
parentda5bcaa49916fd99c1cd2bfe11923e680056abd7 (diff)
downloadglibc-b0a3c1640ab2fb7d16d9b9a8d9c0e524e9cb0001.tar.gz
glibc-b0a3c1640ab2fb7d16d9b9a8d9c0e524e9cb0001.tar.xz
glibc-b0a3c1640ab2fb7d16d9b9a8d9c0e524e9cb0001.zip
Properly handle forced elision in pthread_mutex_trylock (bug 16657)
Diffstat (limited to 'nptl')
-rw-r--r--nptl/pthread_mutex_trylock.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c
index 0293d0f629..3cdf9f175c 100644
--- a/nptl/pthread_mutex_trylock.c
+++ b/nptl/pthread_mutex_trylock.c
@@ -26,8 +26,8 @@
 #define lll_trylock_elision(a,t) lll_trylock(a)
 #endif
 
-#ifndef DO_ELISION
-#define DO_ELISION(m) 0
+#ifndef FORCE_ELISION
+#define FORCE_ELISION(m, s)
 #endif
 
 /* We don't force elision in trylock, because this can lead to inconsistent
@@ -69,7 +69,7 @@ __pthread_mutex_trylock (mutex)
       break;
 
     case PTHREAD_MUTEX_TIMED_ELISION_NP:
-    elision:
+    elision: __attribute__((unused))
       if (lll_trylock_elision (mutex->__data.__lock,
 			       mutex->__data.__elision) != 0)
 	break;
@@ -77,8 +77,7 @@ __pthread_mutex_trylock (mutex)
       return 0;
 
     case PTHREAD_MUTEX_TIMED_NP:
-      if (DO_ELISION (mutex))
-	goto elision;
+      FORCE_ELISION (mutex, goto elision);
       /*FALL THROUGH*/
     case PTHREAD_MUTEX_ADAPTIVE_NP:
     case PTHREAD_MUTEX_ERRORCHECK_NP: