Commit c7051ef6 authored by Davis King's avatar Davis King

Added an error message that prints to STDERR when you accidentally

let an exception sit in a thread pool and don't handle it before the
thread pool is destroyed.
parent 2cca4ae7
...@@ -504,9 +504,23 @@ namespace dlib ...@@ -504,9 +504,23 @@ namespace dlib
~thread_pool ( ~thread_pool (
) )
{
try
{ {
impl->shutdown_pool(); impl->shutdown_pool();
} }
catch (std::exception& e)
{
std::cerr << "An unhandled exception was inside a dlib::thread_pool when it was destructed." << std::endl;
std::cerr << "It's what string is: \n" << e.what() << std::endl;
throw;
}
catch (...)
{
std::cerr << "An unhandled exception was inside a dlib::thread_pool when it was destructed." << std::endl;
throw;
}
}
void wait_for_task ( void wait_for_task (
uint64 task_id uint64 task_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment