From cd511a09aa6ecface515bbbc8be9e6fe78b45463 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Mon, 27 Jan 2025 19:35:49 +0000 Subject: [PATCH] Fix initialization order and remove unused variables in NonBlockingThreadPool.h. --- Eigen/src/ThreadPool/NonBlockingThreadPool.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Eigen/src/ThreadPool/NonBlockingThreadPool.h b/Eigen/src/ThreadPool/NonBlockingThreadPool.h index 2645356ca..c05326ca2 100644 --- a/Eigen/src/ThreadPool/NonBlockingThreadPool.h +++ b/Eigen/src/ThreadPool/NonBlockingThreadPool.h @@ -42,11 +42,11 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface { : env_(env), num_threads_(num_threads), allow_spinning_(allow_spinning), + spin_count_(0), thread_data_(num_threads), all_coprimes_(num_threads), waiters_(num_threads), global_steal_partition_(EncodePartition(0, num_threads_)), - spin_count_(0), spinning_state_(0), blocked_(0), done_(false), @@ -345,8 +345,6 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface { pt->pool = this; pt->rand = GlobalThreadIdHash(); pt->thread_id = thread_id; - Queue& q = thread_data_[thread_id].queue; - EventCount::Waiter* waiter = &waiters_[thread_id]; // TODO(dvyukov,rmlarsen): The time spent in NonEmptyQueueIndex() is // proportional to num_threads_ and we assume that new work is scheduled // at a constant rate, so we divide `kSpintCount` by number of threads