mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 19:29:02 +08:00
Fix a data race in NonBlockingThreadPool
This commit is contained in:
parent
656d9bc66b
commit
0f8bfff23d
@ -29,6 +29,7 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface {
|
||||
thread_data_(num_threads),
|
||||
all_coprimes_(num_threads),
|
||||
waiters_(num_threads),
|
||||
global_steal_partition_(EncodePartition(0, num_threads_)),
|
||||
blocked_(0),
|
||||
spinning_(0),
|
||||
done_(false),
|
||||
@ -56,7 +57,6 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface {
|
||||
thread_data_[i].thread.reset(
|
||||
env_.CreateThread([this, i]() { WorkerLoop(i); }));
|
||||
}
|
||||
global_steal_partition_ = EncodePartition(0, num_threads_);
|
||||
#ifndef EIGEN_THREAD_LOCAL
|
||||
// Wait for workers to initialize per_thread_map_. Otherwise we might race
|
||||
// with them in Schedule or CurrentThreadId.
|
||||
|
Loading…
x
Reference in New Issue
Block a user