OSDN Git Service

2005-10-17 Jonathan Wakely <redi@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / tr1 / boost_shared_ptr.h
index a998fed..8f95ead 100644 (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