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++/24244] Problem with tr1::shared_ptr and pthreads_mutex_lock



------- 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


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