summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-08-06 13:31:35 +0300
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-08-17 19:03:34 +0200
commitc33b304eefddf75509dc40b5cf6ddda4b40ee37f (patch)
tree3ccb7a025d19532ea7bd8b8808f9da878770174c /libpthread
parentace0878b0b708e1b04e9e7a62f26c1dc3b9295b5 (diff)
nptl: fix calling convention for __pthread_mutex_cond_lock
The assembly versions of pthread_cond_wait calls __pthread_mutex_cond_lock and __pthread_mutex_cond_lock_adjust using internal calling convention (which differs from default calling convention at least on x86). Thus these two functions must be defined with internal_function or the call sequence goes wrong. __pthread_mutex_cond_lock resides in sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c, but it does evil macro definitions and includes pthread_mutex_lock.c, so we need to add some extra kludge to pthread_mutex_lock.c to get the prototypes correctly. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/nptl/pthreadP.h6
-rw-r--r--libpthread/nptl/pthread_mutex_lock.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h
index 85601d435..c45bd1170 100644
--- a/libpthread/nptl/pthreadP.h
+++ b/libpthread/nptl/pthreadP.h
@@ -414,8 +414,10 @@ extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex);
extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
extern int __pthread_mutex_lock_internal (pthread_mutex_t *__mutex)
attribute_hidden;
-extern int __pthread_mutex_cond_lock (pthread_mutex_t *__mutex);
-extern void __pthread_mutex_cond_lock_adjust (pthread_mutex_t *__mutex);
+extern int __pthread_mutex_cond_lock (pthread_mutex_t *__mutex)
+ attribute_hidden internal_function;
+extern void __pthread_mutex_cond_lock_adjust (pthread_mutex_t *__mutex)
+ attribute_hidden internal_function;
extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
extern int __pthread_mutex_unlock_internal (pthread_mutex_t *__mutex)
attribute_hidden;
diff --git a/libpthread/nptl/pthread_mutex_lock.c b/libpthread/nptl/pthread_mutex_lock.c
index 78b66711c..77147dbee 100644
--- a/libpthread/nptl/pthread_mutex_lock.c
+++ b/libpthread/nptl/pthread_mutex_lock.c
@@ -42,7 +42,11 @@ static int __pthread_mutex_lock_full (pthread_mutex_t *mutex)
int
+#ifdef NO_INCR
+attribute_hidden internal_function
+#else
attribute_protected
+#endif
__pthread_mutex_lock (
pthread_mutex_t *mutex)
{
@@ -477,7 +481,8 @@ strong_alias (__pthread_mutex_lock, __pthread_mutex_lock_internal)
#ifdef NO_INCR
-void attribute_protected
+void
+attribute_hidden internal_function
__pthread_mutex_cond_lock_adjust (
pthread_mutex_t *mutex)
{