void win32_exception::install_handler() { //#ifndef _DEBUG //_set_se_translator(win32_exception::Handler); installed_for_thread() = true; //#endif }
void win32_exception::ensure_handler_installed_for_thread( const char* thread_description) { if (!installed_for_thread()) { install_handler(); if (thread_description) detail::SetThreadName(GetCurrentThreadId(), thread_description); } }
void win32_exception::ensure_handler_installed_for_thread(const char* thread_description) { if (!installed_for_thread()) { install_handler(); if (thread_description) { std::string threadId = boost::lexical_cast<std::string>(boost::this_thread::get_id()); unsigned long threadNumber = 0; sscanf(threadId.c_str(), "%lx", &threadNumber); //detail::SetThreadName(GetCurrentThreadId(), thread_description); windows version of the func detail::SetThreadName(threadNumber, thread_description); get_thread_info().name = thread_description; } } }