This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/24244] Problem with tr1::shared_ptr and pthreads_mutex_lock
- From: "bkoz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Oct 2005 05:36:25 -0000
- Subject: [Bug libstdc++/24244] Problem with tr1::shared_ptr and pthreads_mutex_lock
- References: <bug-24244-133@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from bkoz at gcc dot gnu dot org 2005-10-13 05:36 -------
This locking code looks really strange to me.
void
release() // nothrow
{
if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) == 1)
{
dispose();
__glibcxx_mutex_lock(_M_mutex);
__glibcxx_mutex_unlock(_M_mutex);
weak_release();
}
}
Anyway. Any chance this could be commented? What's being attempted?
Also, Paolo, if you've been able to reproduce this problem, I'd appreciate a
test case that demonstrates the issue checked in with the patch. Then, if the
locking bits get changed in the future we won't run into this regression if
things aren't quite right.
As it stands now, I have no idea what the problem is, or was, other than the
mutex was never initialized.
-benjamin
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24244