On 9/14/13 6:31 PM, Ángel González wrote:
Hmm, yes, it seems doable.
I think it could even be implemented without __prev_owner.
This may be such an implementation (to replace the nptl/lowlevellock.h
__generic_mutex_lock).
In my case I am not seeing this code path used. This is linux, x86_64
and from what I can see the code path is:
pthread_mutex_lock == __pthread_mutex_lock()
In the latter you hit the 'simple:' goto path, and then LLL_MUTEX_LOCK
which is a macro to lll_lock and that comes from
nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h.
I can read asm well enough to get the gist of the code but I do not
know asm near good enough to implement your suggestion below.
David