------- Comment #8 from pcarlini at suse dot de 2005-11-17 13:50 ------- I have got additional evidence that __sync_fetch_and_add does not work correctly. If, for example, in this code, stressed in the testcase 12658_thread-1.cc, and using atomic operations:
const locale& locale::operator=(const locale& __other) throw() { __other._M_impl->_M_add_reference(); _M_impl->_M_remove_reference(); _M_impl = __other._M_impl; return *this; } I wrap everything in the locale_cons mutex then the testcase doesn't fail anymore. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24757