aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@codesourcery.com>2012-08-15 16:44:30 -0700
committerMaxim Kuvyrkov <maxim@codesourcery.com>2012-08-15 16:44:30 -0700
commit309becf120640bb0fdd1a16e65996c23d0542590 (patch)
tree6adbada4d391a306dd2e4558626f759a7cadbed7 /nptl
parentef4009734b84903615be28b38638c166e5455692 (diff)
downloadglibc-309becf120640bb0fdd1a16e65996c23d0542590.zip
glibc-309becf120640bb0fdd1a16e65996c23d0542590.tar.gz
glibc-309becf120640bb0fdd1a16e65996c23d0542590.tar.bz2
Optimize __libc_lock_lock and __libc_lock_trylock for MIPS.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog6
-rw-r--r--nptl/sysdeps/pthread/bits/libc-lockP.h10
2 files changed, 14 insertions, 2 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 0f31b4d..545b2c2 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-15 Tom de Vries <vries@codesourcery.com>
+ Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * sysdeps/pthread/bits/libc-lockP.h (__libc_lock_lock)
+ (__libc_lock_trylock): Allow pre-existing definitions.
+
2012-08-15 Maxim Kuvyrkov <maxim@codesourcery.com>
* pthread_spin_lock.c: New file.
diff --git a/nptl/sysdeps/pthread/bits/libc-lockP.h b/nptl/sysdeps/pthread/bits/libc-lockP.h
index 0ebac91..7adaeb4 100644
--- a/nptl/sysdeps/pthread/bits/libc-lockP.h
+++ b/nptl/sysdeps/pthread/bits/libc-lockP.h
@@ -176,9 +176,12 @@ typedef pthread_key_t __libc_key_t;
/* Lock the named lock variable. */
#if !defined NOT_IN_libc || defined IS_IN_libpthread
-# define __libc_lock_lock(NAME) \
+# ifndef __libc_lock_lock
+# define __libc_lock_lock(NAME) \
({ lll_lock (NAME, LLL_PRIVATE); 0; })
+# endif
#else
+# undef __libc_lock_lock
# define __libc_lock_lock(NAME) \
__libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0)
#endif
@@ -189,9 +192,12 @@ typedef pthread_key_t __libc_key_t;
/* Try to lock the named lock variable. */
#if !defined NOT_IN_libc || defined IS_IN_libpthread
-# define __libc_lock_trylock(NAME) \
+# ifndef __libc_lock_trylock
+# define __libc_lock_trylock(NAME) \
lll_trylock (NAME)
+# endif
#else
+# undef __libc_lock_trylock
# define __libc_lock_trylock(NAME) \
__libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
#endif