Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2007-10-25 03:17:21


Author: anthonyw
Date: 2007-10-25 03:17:20 EDT (Thu, 25 Oct 2007)
New Revision: 40456
URL: http://svn.boost.org/trac/boost/changeset/40456

Log:
thread move constructor is not explicit, so self() compiles for MSVC8 and Intel; thread_exit_callback_node constructor added to remove warnings on MSVC8; thread destructor no longer calls cancel
Text files modified:
   trunk/boost/thread/pthread/thread.hpp | 6 ++----
   trunk/boost/thread/win32/thread.hpp | 2 +-
   trunk/libs/thread/src/win32/thread.cpp | 12 ++++++++----
   3 files changed, 11 insertions(+), 9 deletions(-)

Modified: trunk/boost/thread/pthread/thread.hpp
==============================================================================
--- trunk/boost/thread/pthread/thread.hpp (original)
+++ trunk/boost/thread/pthread/thread.hpp 2007-10-25 03:17:20 EDT (Thu, 25 Oct 2007)
@@ -150,7 +150,7 @@
     public:
         thread();
         ~thread();
-
+
         template <class F>
         explicit thread(F f):
             thread_info(new thread_data<F>(f))
@@ -158,7 +158,7 @@
             start_thread();
         }
         template <class F>
- explicit thread(boost::move_t<F> f):
+ thread(boost::move_t<F> f):
             thread_info(new thread_data<F>(f))
         {
             start_thread();
@@ -193,8 +193,6 @@
         cancel_handle get_cancel_handle() const;
         void cancel();
         bool cancellation_requested() const;
-
- static thread self();
     };
 
     namespace this_thread

Modified: trunk/boost/thread/win32/thread.hpp
==============================================================================
--- trunk/boost/thread/win32/thread.hpp (original)
+++ trunk/boost/thread/win32/thread.hpp 2007-10-25 03:17:20 EDT (Thu, 25 Oct 2007)
@@ -117,7 +117,7 @@
             start_thread();
         }
 
- explicit thread(boost::move_t<thread> x);
+ thread(boost::move_t<thread> x);
         thread& operator=(boost::move_t<thread> x);
         operator boost::move_t<thread>();
         boost::move_t<thread> move();

Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2007-10-25 03:17:20 EDT (Thu, 25 Oct 2007)
@@ -162,7 +162,6 @@
     
     thread::~thread()
     {
- cancel();
         detach();
     }
     
@@ -381,6 +380,11 @@
         {
             boost::detail::thread_exit_function_base* func;
             thread_exit_callback_node* next;
+
+ thread_exit_callback_node(boost::detail::thread_exit_function_base* func_,
+ thread_exit_callback_node* next_):
+ func(func_),next(next_)
+ {}
         };
     }
     namespace
@@ -434,9 +438,9 @@
     {
         void add_thread_exit_function(thread_exit_function_base* func)
         {
- thread_exit_callback_node* const new_node=heap_new<thread_exit_callback_node>();
- new_node->func=func;
- new_node->next=get_current_thread_data()->thread_exit_callbacks;
+ thread_exit_callback_node* const new_node=
+ heap_new<thread_exit_callback_node>(func,
+ get_current_thread_data()->thread_exit_callbacks);
             get_current_thread_data()->thread_exit_callbacks=new_node;
         }
     }


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