http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46455
--- Comment #11 from Zouzou <internet at 123gen dot com> 2010-11-15 16:30:21 UTC --- (In reply to comment #10) > That's because my simpler test ignores the default_lock_policy, it always uses > a mutex, which is what shared_ptr does when __default_lock_policy=1 > I've just looked at __gnu_cxx::__mutex and it doesn't have a destructor, so > the > problem is probably just that we leak the mutex. This should show the same > bug: > #include <ext/concurrence.h> > int main() > { > for (int i=0; i<100; ++i) > __gnu_cxx::__mutex m; > } > Could you test that? > We should add a destructor to __mutex, which calls __gthread_mutex_destroy. > N.B. this could cause a problem on FreeBSD > http://www.freebsd.org/cgi/query-pr.cgi?pr=150889 > so we might want to only call __gthread_mutex_destroy when we have used > __GTHREAD_MUTEX_INIT_FUNCTION this does reproduce the issue on both vanilla MinGW and MinGW64.