diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/impl/win_thread.ipp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/impl/win_thread.ipp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/impl/win_thread.ipp b/3rdParty/Boost/src/boost/asio/detail/impl/win_thread.ipp index 07cc5c2..744990d 100644 --- a/3rdParty/Boost/src/boost/asio/detail/impl/win_thread.ipp +++ b/3rdParty/Boost/src/boost/asio/detail/impl/win_thread.ipp @@ -2,7 +2,7 @@ // detail/impl/win_thread.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -102,12 +102,12 @@ void win_thread::start_thread(func_base* arg, unsigned int stack_size) unsigned int __stdcall win_thread_function(void* arg) { - std::auto_ptr<win_thread::func_base> func( - static_cast<win_thread::func_base*>(arg)); + win_thread::auto_func_base_ptr func = { + static_cast<win_thread::func_base*>(arg) }; - ::SetEvent(func->entry_event_); + ::SetEvent(func.ptr->entry_event_); - func->run(); + func.ptr->run(); // Signal that the thread has finished its work, but rather than returning go // to sleep to put the thread into a well known state. If the thread is being @@ -115,8 +115,9 @@ unsigned int __stdcall win_thread_function(void* arg) // TerminateThread (to avoid a deadlock in DllMain). Otherwise, the SleepEx // call will be interrupted using QueueUserAPC and the thread will shut down // cleanly. - HANDLE exit_event = func->exit_event_; - func.reset(); + HANDLE exit_event = func.ptr->exit_event_; + delete func.ptr; + func.ptr = 0; ::SetEvent(exit_event); ::SleepEx(INFINITE, TRUE); |