http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51296
--- Comment #26 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> 2012-01-16 18:58:20 UTC --- > --- Comment #25 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-13 > 10:37:52 UTC --- > Nice digging. POSIX does say the INIT macro is for use when the mutex is > statically-allocated: > > "In cases where default mutex attributes are appropriate, the macro > PTHREAD_MUTEX_INITIALIZER can be used to initialize mutexes that are > statically > allocated." > > > For most platforms it works fine for automatic variables and in C++ for member > variables too. > > Maybe something scans the BSS segment at startup to find mutexes?! In any > case, it looks as though we should definitely use the init function instead of > the macro on Tru64. Unfortunately, while my test to do so fixes the 30_threads failures, it introduced tons of failures elsewhere (both libstdc++ and others). I don't fully understand what's happening there, but perhaps we need a fix in libstdc++ instead, especially given that the use of PTHREAD_MUTEX_INITIALIZER at hand isn't standard-conforming. Rainer