workPool: do not notify empty threads

This commit is contained in:
tildearrow 2023-09-07 00:21:26 -05:00
parent 9b276e80f8
commit 64669e4d9b

View file

@ -141,7 +141,7 @@ void DivWorkPool::wait() {
// start running
for (unsigned int i=0; i<count; i++) {
if (!workThreads[i].promiseAlreadySet) {
if (!workThreads[i].promiseAlreadySet && !workThreads[i].tasks.empty()) {
try {
workThreads[i].lock.lock();
workThreads[i].promiseAlreadySet=true;