From ee3d772235bf4300a8b66337f849ca7ace5bc3a1 Mon Sep 17 00:00:00 2001 From: Anthony Williams Date: Thu, 25 Oct 2007 07:17:20 +0000 Subject: [PATCH] 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 [SVN r40456] --- include/boost/thread/pthread/thread.hpp | 6 ++---- include/boost/thread/win32/thread.hpp | 2 +- src/win32/thread.cpp | 12 ++++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/boost/thread/pthread/thread.hpp b/include/boost/thread/pthread/thread.hpp index 199f3b0c..76b503ee 100644 --- a/include/boost/thread/pthread/thread.hpp +++ b/include/boost/thread/pthread/thread.hpp @@ -150,7 +150,7 @@ namespace boost public: thread(); ~thread(); - + template explicit thread(F f): thread_info(new thread_data(f)) @@ -158,7 +158,7 @@ namespace boost start_thread(); } template - explicit thread(boost::move_t f): + thread(boost::move_t f): thread_info(new thread_data(f)) { start_thread(); @@ -193,8 +193,6 @@ namespace boost cancel_handle get_cancel_handle() const; void cancel(); bool cancellation_requested() const; - - static thread self(); }; namespace this_thread diff --git a/include/boost/thread/win32/thread.hpp b/include/boost/thread/win32/thread.hpp index 8e143f8e..766b2068 100644 --- a/include/boost/thread/win32/thread.hpp +++ b/include/boost/thread/win32/thread.hpp @@ -117,7 +117,7 @@ namespace boost start_thread(); } - explicit thread(boost::move_t x); + thread(boost::move_t x); thread& operator=(boost::move_t x); operator boost::move_t(); boost::move_t move(); diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 94462b94..88ec8b88 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -162,7 +162,6 @@ namespace boost thread::~thread() { - cancel(); detach(); } @@ -381,6 +380,11 @@ namespace boost { 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 @@ namespace boost { void add_thread_exit_function(thread_exit_function_base* func) { - thread_exit_callback_node* const new_node=heap_new(); - new_node->func=func; - new_node->next=get_current_thread_data()->thread_exit_callbacks; + thread_exit_callback_node* const new_node= + heap_new(func, + get_current_thread_data()->thread_exit_callbacks); get_current_thread_data()->thread_exit_callbacks=new_node; } }