The following code from Andreas Messer fails with an assertion when run on a system with hardware support for lock elision, and with a libc with lock elision enabled. #include <pthread.h> #include <time.h> int main(int argc, char* argv[]) { pthread_mutex_t mutex; pthread_mutexattr_t attr; struct timespec ts; pthread_mutexattr_init( &attr ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK ); pthread_mutex_init( &mutex, &attr ); clock_gettime( CLOCK_REALTIME, &ts ); ts.tv_sec += 3; pthread_mutex_timedlock( &mutex, &ts ); pthread_mutex_unlock(&mutex); return 0; } It returns the following assertion: a.out: pthread_mutex_unlock.c:87: __pthread_mutex_unlock_usercnt: Assertion `type == PTHREAD_MUTEX_ERRORCHECK_NP' failed. Aborted Patch will follow on the mailing list.
. *** This bug has been marked as a duplicate of bug 17514 ***