Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62650 - in trunk: boost/thread/detail libs/thread/src/pthread libs/thread/src/win32
From: anthony_at_[hidden]
Date: 2010-06-09 07:35:42


Author: anthonyw
Date: 2010-06-09 07:35:41 EDT (Wed, 09 Jun 2010)
New Revision: 62650
URL: http://svn.boost.org/trac/boost/changeset/62650

Log:
Removed thread_info_mutex as unnecessary and cause of potentially-throwing destructor. Fix for issue #3097
Text files modified:
   trunk/boost/thread/detail/thread.hpp | 1 -
   trunk/libs/thread/src/pthread/thread.cpp | 8 +-------
   trunk/libs/thread/src/win32/thread.cpp | 2 --
   3 files changed, 1 insertions(+), 10 deletions(-)

Modified: trunk/boost/thread/detail/thread.hpp
==============================================================================
--- trunk/boost/thread/detail/thread.hpp (original)
+++ trunk/boost/thread/detail/thread.hpp 2010-06-09 07:35:41 EDT (Wed, 09 Jun 2010)
@@ -115,7 +115,6 @@
 
         void release_handle();
         
- mutable boost::mutex thread_info_mutex;
         detail::thread_data_ptr thread_info;
 
         void start_thread();

Modified: trunk/libs/thread/src/pthread/thread.cpp
==============================================================================
--- trunk/libs/thread/src/pthread/thread.cpp (original)
+++ trunk/libs/thread/src/pthread/thread.cpp 2010-06-09 07:35:41 EDT (Wed, 09 Jun 2010)
@@ -198,7 +198,6 @@
 
     detail::thread_data_ptr thread::get_thread_info() const
     {
- lock_guard<mutex> l(thread_info_mutex);
         return thread_info;
     }
 
@@ -238,7 +237,6 @@
                 local_thread_info->done_condition.notify_all();
             }
             
- lock_guard<mutex> l1(thread_info_mutex);
             if(thread_info==local_thread_info)
             {
                 thread_info.reset();
@@ -285,7 +283,6 @@
                 local_thread_info->done_condition.notify_all();
             }
             
- lock_guard<mutex> l1(thread_info_mutex);
             if(thread_info==local_thread_info)
             {
                 thread_info.reset();
@@ -303,10 +300,7 @@
     void thread::detach()
     {
         detail::thread_data_ptr local_thread_info;
- {
- lock_guard<mutex> l1(thread_info_mutex);
- thread_info.swap(local_thread_info);
- }
+ thread_info.swap(local_thread_info);
         
         if(local_thread_info)
         {

Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2010-06-09 07:35:41 EDT (Wed, 09 Jun 2010)
@@ -283,7 +283,6 @@
 
     void thread::release_handle()
     {
- lock_guard<mutex> l1(thread_info_mutex);
         thread_info=0;
     }
     
@@ -317,7 +316,6 @@
 
     detail::thread_data_ptr thread::get_thread_info() const
     {
- boost::mutex::scoped_lock l(thread_info_mutex);
         return thread_info;
     }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk