[PATCH] Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock.

Siddhesh Poyarekar siddhesh@gotplt.org
Mon Feb 6 08:34:00 GMT 2017


On Tuesday 13 December 2016 02:24 PM, Stefan Liebler wrote:
> Hi,
> 
> the macros lll_trylock, lll_cond_trylock are extended by a
> __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.
> 
> Okay to commit?

Yes, looks good.

Siddhesh



More information about the Libc-alpha mailing list