diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h index 1ac4de3b5..d710faa94 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h @@ -169,16 +169,16 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface { EventCount ec_; #ifndef EIGEN_THREAD_LOCAL std::unique_ptr init_barrier_; - std::mutex mu; // Protects per_thread_map_. + std::mutex per_thread_map_mutex_; // Protects per_thread_map_. std::unordered_map> per_thread_map_; #endif // Main worker thread loop. void WorkerLoop(int thread_id) { #ifndef EIGEN_THREAD_LOCAL - mu.lock(); + per_thread_map_mutex_.lock(); eigen_assert(per_thread_map_.emplace(GlobalThreadIdHash(), new PerThread()).second); - mu.unlock(); + per_thread_map_mutex_.unlock(); init_barrier_->Notify(); init_barrier_->Wait(); #endif