mirror of
https://github.com/monero-project/monero.git
synced 2025-08-11 02:40:08 -04:00
threadpool: catch exceptions in dtor, to avoid terminate
If an exception is thrown, it is ignored. While this may hide a bug, this should only be system exceptions in boost, which is pretty unlikely. Morever, wait should be called manually before the dtor anyway. Add an error message if the dtor has to wait in case some such cases creep in so they get fixed. Coverity 182538
This commit is contained in:
parent
24803ed91f
commit
9b98a6ac8f
2 changed files with 20 additions and 1 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <functional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace tools
|
||||
{
|
||||
|
@ -57,7 +58,7 @@ public:
|
|||
void dec();
|
||||
void wait(); //! Wait for a set of tasks to finish.
|
||||
waiter() : num(0){}
|
||||
~waiter() { wait(); }
|
||||
~waiter();
|
||||
};
|
||||
|
||||
// Submit a task to the pool. The waiter pointer may be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue