diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:51 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:51 +0200 |
commit | 99f841c441feeaa9a3d97fd91bb3d6ec8073c982 (patch) | |
tree | 679184226a8c4d55e7981f03a758361122267cc9 /nptl/pthread_mutex_cond_lock.c | |
parent | eda0c098ed31489ce21f15d775ed96c1f6b395ad (diff) | |
download | glibc-99f841c441feeaa9a3d97fd91bb3d6ec8073c982.tar.gz glibc-99f841c441feeaa9a3d97fd91bb3d6ec8073c982.tar.xz glibc-99f841c441feeaa9a3d97fd91bb3d6ec8073c982.zip |
nptl: pthread_mutex_lock, pthread_mutex_unock single-threaded optimization
This is optimization is similar in spirit to the SINGLE_THREAD_P check in the malloc implementation. Doing this in generic code allows us to prioritize those cases which are likely to occur in single-threaded programs (normal and recursive mutexes). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/pthread_mutex_cond_lock.c')
-rw-r--r-- | nptl/pthread_mutex_cond_lock.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/nptl/pthread_mutex_cond_lock.c b/nptl/pthread_mutex_cond_lock.c index 2f0771302f..3386bd689b 100644 --- a/nptl/pthread_mutex_cond_lock.c +++ b/nptl/pthread_mutex_cond_lock.c @@ -2,6 +2,7 @@ #define LLL_MUTEX_LOCK(mutex) \ lll_cond_lock ((mutex)->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex)) +#define LLL_MUTEX_LOCK_OPTIMIZED(mutex) LLL_MUTEX_LOCK (mutex) /* Not actually elided so far. Needed? */ #define LLL_MUTEX_LOCK_ELISION(mutex) \ |