ThreadPool: On exception, interrupt the other worker threads
This commit is contained in:
parent
6a888ec29a
commit
b7376edf06
4 changed files with 14 additions and 7 deletions
|
@ -273,13 +273,16 @@ void closeOnExec(int fd);
|
|||
|
||||
extern bool _isInterrupted;
|
||||
|
||||
extern thread_local std::function<bool()> interruptCheck;
|
||||
|
||||
void setInterruptThrown();
|
||||
|
||||
void _interrupted();
|
||||
|
||||
void inline checkInterrupt()
|
||||
{
|
||||
if (_isInterrupted) _interrupted();
|
||||
if (_isInterrupted || (interruptCheck && interruptCheck()))
|
||||
_interrupted();
|
||||
}
|
||||
|
||||
MakeError(Interrupted, BaseError)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue