re PR libstdc++/24244 (Problem with tr1::shared_ptr and pthreads_mutex_lock)

2005-10-17  Jonathan Wakely  <redi@gcc.gnu.org>

	PR libstdc++/24244
	* include/tr1/boost_shared_ptr.h (_Sp_counted_base::_Sp_counted_base()):
	When __GTHREAD_MUTEX_INIT is defined, initialize the mutex.

From-SVN: r105506
This commit is contained in:
Jonathan Wakely 2005-10-17 18:23:42 +01:00 committed by Paolo Carlini
parent 15c85bc270
commit 7010f39ea6
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-10-17 Jonathan Wakely <redi@gcc.gnu.org>
PR libstdc++/24244
* include/tr1/boost_shared_ptr.h (_Sp_counted_base::_Sp_counted_base()):
When __GTHREAD_MUTEX_INIT is defined, initialize the mutex.
2005-10-15 Paolo Carlini <pcarlini@suse.de>
* include/tr1/functional: Add missing #pragma GCC system_header.

View File

@ -101,7 +101,14 @@ public:
_Sp_counted_base()
: _M_use_count(1), _M_weak_count(1)
{ }
{
// For the case of __GTHREAD_MUTEX_INIT we haven't initialised
// the mutex yet, so do it now.
#if defined(__GTHREADS) && defined(__GTHREAD_MUTEX_INIT)
__gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
_M_mutex = __tmp;
#endif
}
virtual
~_Sp_counted_base() // nothrow