Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66588 - branches/release/libs/thread/src/win32
From: anthony_at_[hidden]
Date: 2010-11-15 05:13:17


Author: anthonyw
Date: 2010-11-15 05:13:12 EST (Mon, 15 Nov 2010)
New Revision: 66588
URL: http://svn.boost.org/trac/boost/changeset/66588

Log:
Merged fix for issue #4736 from trunk
Text files modified:
   branches/release/libs/thread/src/win32/thread.cpp | 16 +++++++++++-----
   1 files changed, 11 insertions(+), 5 deletions(-)

Modified: branches/release/libs/thread/src/win32/thread.cpp
==============================================================================
--- branches/release/libs/thread/src/win32/thread.cpp (original)
+++ branches/release/libs/thread/src/win32/thread.cpp 2010-11-15 05:13:12 EST (Mon, 15 Nov 2010)
@@ -58,6 +58,8 @@
             boost::call_once(current_thread_tls_init_flag,create_current_thread_tls_key);
             if(current_thread_tls_key)
                 BOOST_VERIFY(TlsSetValue(current_thread_tls_key,new_data));
+ else
+ boost::throw_exception(thread_resource_error());
         }
 
 #ifdef BOOST_NO_THREADEX
@@ -222,15 +224,19 @@
         void make_external_thread_data()
         {
             externally_launched_thread* me=detail::heap_new<externally_launched_thread>();
- set_current_thread_data(me);
+ try
+ {
+ set_current_thread_data(me);
+ }
+ catch(...)
+ {
+ detail::heap_delete(me);
+ throw;
+ }
         }
 
         detail::thread_data_base* get_or_make_current_thread_data()
         {
- if(!current_thread_tls_key)
- {
- throw thread_resource_error();
- }
             detail::thread_data_base* current_thread_data(get_current_thread_data());
             if(!current_thread_data)
             {


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