diff options
author | Jonathan Wakely <redi@gcc.gnu.org> | 2005-10-17 18:23:42 +0100 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2005-10-17 17:23:42 +0000 |
commit | 7010f39ea6c659080e9aaf7327585a58f4d1a666 (patch) | |
tree | 6966989eed1920cccfb6e305fa941b06cdcc750e | |
parent | 15c85bc2702bdc00ff9aa6b90c77803769223cbb (diff) | |
download | gcc-7010f39ea6c659080e9aaf7327585a58f4d1a666.zip gcc-7010f39ea6c659080e9aaf7327585a58f4d1a666.tar.gz gcc-7010f39ea6c659080e9aaf7327585a58f4d1a666.tar.bz2 |
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1/boost_shared_ptr.h | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b316543..48c588f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/include/tr1/boost_shared_ptr.h b/libstdc++-v3/include/tr1/boost_shared_ptr.h index a998fed..8f95ead 100644 --- a/libstdc++-v3/include/tr1/boost_shared_ptr.h +++ b/libstdc++-v3/include/tr1/boost_shared_ptr.h @@ -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 |