This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/55471] c++ mutex does not work as expected


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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-11-26 19:24:38 UTC ---
Almost certainly what happens is that the mutex m gets destroyed when returning
from main, but there are threads still using it and so they can no longer lock
it.

It's undefined behaviour to lock a mutex after its destructor starts, so this
is a bug in your program, not GCC.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]