On 09/27/2015 12:24 PM, Jonathan Wakely wrote:
> Doh, sorry, I meant this instead i.e. the non-recursive mutex.

> +# if _GLIBCXX_ASSERTIONS && defined(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP)
> +    // Use an error-checking mutex type when assertions are enabled.
> +    __native_type  _M_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
> +# else
>      __native_type  _M_mutex = __GTHREAD_MUTEX_INIT;
> +# endif

I think we should abort on a self-deadlock or an invalid unlock instead.
 If this change is valid for libstdc++, it should probably happen at the
glibc level (perhaps guarded by _FORTIFY_SOURCE) because C programs
would benefit as well.

We'd need performance numbers to justify the change.  Any ideas how to
get them?  Benchmark MariaDB?  What's another large multi-threaded
application?  Qpid perhaps?

-- 
Florian Weimer / Red Hat Product Security

Reply via email to