On Fri, Jun 26, 2015 at 12:07:36PM +0000, Antti Kantee wrote: > On 26/06/15 11:53, Joerg Sonnenberger wrote: > >That said, have > >you verified why it doesn't happen with libstdc++ itself? I would > >somewhat suspect that the threatment of the header as system header > >hides the problem for libstdc++, I can't imagine that it can correctly > >implement the constexpr constructor without performance penalties > >otherwise... > > I don't speak C++, but a grep-based guess coupled with common sense suggests > that libstdc++ is fine because it doesn't use PTHREAD_MUTEX_INITIALIZER.
It is spelled __GTHREAD_MUTEX_INIT or something like that and goes via another layer of indirection. Without it, the constexpr version would need another flag bit, see above about runtime penalty. Joerg