From 4f450c30825cea32efbdc908b16ae46a925473fd Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Mon, 27 Jan 2025 11:51:52 -0800 Subject: [PATCH] Fix threadpool for c++14. If-statment initializers are c++17. Replaced with the dreaded comma operator, which should return the second part and result in the same result. --- Eigen/src/ThreadPool/NonBlockingThreadPool.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Eigen/src/ThreadPool/NonBlockingThreadPool.h b/Eigen/src/ThreadPool/NonBlockingThreadPool.h index c05326ca2..65a222c74 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 -- GitLab