diff --git a/Eigen/src/ThreadPool/NonBlockingThreadPool.h b/Eigen/src/ThreadPool/NonBlockingThreadPool.h index c05326ca2957b5517dbde0b90b0144b4e471531d..65a222c74975b1c50be9b3545a3a9a9faa5d20b0 100644 --- a/Eigen/src/ThreadPool/NonBlockingThreadPool.h +++ b/Eigen/src/ThreadPool/NonBlockingThreadPool.h @@ -153,7 +153,8 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface { void MaybeGetTask(Task* t) { PerThread* pt = GetPerThread(); Queue& q = thread_data_[pt->thread_id].queue; - if (*t = q.PopFront(); t->f) return; + *t = q.PopFront(); + if (t->f != nullptr) return; if (num_threads_ == 1) { // For num_threads_ == 1 there is no point in going through the expensive // steal loop. Moreover, since NonEmptyQueueIndex() calls PopBack() on the