http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51296

--- Comment #27 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-16 
19:36:49 UTC ---
C++11 requires that std::mutex::mutex() is constexpr, so that a global
std::mutex will be statically initialized. If that constructor is constexpr it
can't call pthread_mutex_init().

But C++11 also requires non-global, non-static mutexes to be possible, so we
can't use the PTHREAD_MUTEX_INITIALIZER either.

The option we've taken is to ignore the text I quoted in comment 25 and rely on
the macro working for non-statically allocated mutexes, which works on most
platforms.

Reply via email to