[PATCH 1/9] Add the low level infrastructure for pthreads lock elision with TSX

Florian Weimer fweimer@redhat.com
Wed Jan 23 08:17:00 GMT 2013


On 01/22/2013 10:39 PM, Andi Kleen wrote:

> +      /* When this could be a nested trylock that is not explicitely
> +	 declared an elided lock abort. This makes us follow POSIX
> +	 paper semantics. */
> +      if (upgraded)
> +        _xabort (0xfd);
> +
> +      if ((status = _xbegin()) == _XBEGIN_STARTED)
> +	{
> +	  if (*futex == 0)
> +	    return 0;
> +
> +	  /* Lock was busy. Fall back to normal locking.
> +	     Could also _xend here but xabort with 0xff code
> +	     is more visible in the profiler. */
> +	  _xabort (0xff);
> +	}

Shouldn't 0xfd, 0xff be #defines or enum constants?

-- 
Florian Weimer / Red Hat Product Security Team



More information about the Libc-alpha mailing list