]> sourceware.org Git - glibc.git/commit
Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Mon, 6 Feb 2017 12:44:23 +0000 (13:44 +0100)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Mon, 6 Feb 2017 12:46:01 +0000 (13:46 +0100)
commitdf3a4e104fb63f96f05b29931dd83e272c2b7936
tree522482c35a920df919a91102c0b4a54bd897d97a
parentf2d7f23a300f57e36cd849ce80a93ccbcebd9968
Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock.

The macros lll_trylock, lll_cond_trylock are extended by an __glibc_unlikely
hint.  Now the trylock macros are based on the same assumption about a
free/busy lock as lll_lock.
With the hint gcc emits code in e.g. pthread_mutex_trylock which does
not use jumps if the lock is free.  Without the hint it had to jump away
if the lock is free.

Tested on s390x, ppc.

ChangeLog:

* sysdeps/nptl/lowlevellock.h (lll_trylock, lll_cond_trylock):
Add __glibc_unlikely hint.
ChangeLog
sysdeps/nptl/lowlevellock.h
This page took 0.042658 seconds and 5 git commands to generate.