mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
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.
This commit is contained in:
parent
2cca4ae7f4
commit
c7051ef606
@ -505,7 +505,21 @@ namespace dlib
|
|||||||
~thread_pool (
|
~thread_pool (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
impl->shutdown_pool();
|
try
|
||||||
|
{
|
||||||
|
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 (
|
||||||
|
Loading…
Reference in New Issue
Block a user