2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-09 11:32:12 +00:00

Thread: cleanup no-exceptions on windows

[SVN r79384]
This commit is contained in:
Vicente J. Botet Escriba
2012-07-09 16:50:35 +00:00
parent 2ea1aec7fd
commit bcf30f2dfc
5 changed files with 68 additions and 26 deletions

View File

@@ -183,16 +183,20 @@ namespace boost
{
detail::thread_data_base* const thread_info(reinterpret_cast<detail::thread_data_base*>(param));
set_current_thread_data(thread_info);
try
#ifndef BOOST_NO_EXCEPTIONS
try // BOOST_NO_EXCEPTIONS protected
#endif
{
thread_info->run();
}
catch(thread_interrupted const&)
#ifndef BOOST_NO_EXCEPTIONS
catch(thread_interrupted const&) // BOOST_NO_EXCEPTIONS protected
{
}
#endif
// Removed as it stops the debugger identifying the cause of the exception
// Unhandled exceptions still cause the application to terminate
// catch(...)
// catch(...) // BOOST_NO_EXCEPTIONS protected
// {
// std::terminate();
// }
@@ -254,15 +258,19 @@ namespace boost
void make_external_thread_data()
{
externally_launched_thread* me=detail::heap_new<externally_launched_thread>();
try
#ifndef BOOST_NO_EXCEPTIONS
try // BOOST_NO_EXCEPTIONS protected
#endif
{
set_current_thread_data(me);
}
catch(...)
#ifndef BOOST_NO_EXCEPTIONS
catch(...) // BOOST_NO_EXCEPTIONS protected
{
detail::heap_delete(me);
throw;
throw; // BOOST_NO_EXCEPTIONS protected
}
#endif
}
detail::thread_data_base* get_or_make_current_thread_data()