mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix Eigen::ThreadPool::CurrentThreadId returning wrong thread id when EIGEN_AVOID_THREAD_LOCAL and NDEBUG are defined
This commit is contained in:
@@ -255,7 +255,9 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface {
|
|||||||
#ifndef EIGEN_THREAD_LOCAL
|
#ifndef EIGEN_THREAD_LOCAL
|
||||||
std::unique_ptr<PerThread> new_pt(new PerThread());
|
std::unique_ptr<PerThread> new_pt(new PerThread());
|
||||||
per_thread_map_mutex_.lock();
|
per_thread_map_mutex_.lock();
|
||||||
eigen_plain_assert(per_thread_map_.emplace(GlobalThreadIdHash(), std::move(new_pt)).second);
|
bool insertOK = per_thread_map_.emplace(GlobalThreadIdHash(), std::move(new_pt)).second;
|
||||||
|
eigen_plain_assert(insertOK);
|
||||||
|
EIGEN_UNUSED_VARIABLE(insertOK);
|
||||||
per_thread_map_mutex_.unlock();
|
per_thread_map_mutex_.unlock();
|
||||||
init_barrier_->Notify();
|
init_barrier_->Notify();
|
||||||
init_barrier_->Wait();
|
init_barrier_->Wait();
|
||||||
|
|||||||
Reference in New Issue
Block a user