This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51296] Several 30_threads tests FAIL on Tru64 UNIX
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 Jan 2012 19:36:49 +0000
- Subject: [Bug libstdc++/51296] Several 30_threads tests FAIL on Tru64 UNIX
- Auto-submitted: auto-generated
- References: <bug-51296-4@http.gcc.gnu.org/bugzilla/>
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.