[RFC] Lock elision implementation guidelines
Roland McGrath
roland@hack.frob.com
Mon Feb 25 21:26:00 GMT 2013
> PTHREAD_MUTEX_RECURSIVE: No. While correctly-used recursive lock/unlock
> do work, this mutex type is specified to return an error if a thread
> unlocks a mutex that is not acquired or not acquired by this thread.
This may merit a POSIX interpretation request. The DESCRIPTION section for
pthread_mutex_*lock does say, in the paragraph about
PTHREAD_MUTEX_RECURSIVE, "If a thread attempts to unlock a mutex that it
has not locked or a mutex which is unlocked, an error shall be returned."
But the ERRORS section does not list any error code for this case. If it
were to, and it were listed as a "may fail" rather than a "shall fail",
then there could be some flexibility here.
More information about the Libc-alpha
mailing list