mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-07 05:31:48 +08:00
Fix the typing of the Tasks in ForkJoin.h
This commit is contained in:
parent
2cd47d743e
commit
11fd34cc1c
@ -92,6 +92,7 @@ class ForkJoinScheduler {
|
|||||||
// Schedules `right_thunk`, runs `left_thunk`, and runs other tasks until `right_thunk` has finished.
|
// Schedules `right_thunk`, runs `left_thunk`, and runs other tasks until `right_thunk` has finished.
|
||||||
template <typename LeftType, typename RightType, typename ThreadPoolEnv>
|
template <typename LeftType, typename RightType, typename ThreadPoolEnv>
|
||||||
static void ForkJoin(LeftType&& left_thunk, RightType&& right_thunk, ThreadPoolTempl<ThreadPoolEnv>* thread_pool) {
|
static void ForkJoin(LeftType&& left_thunk, RightType&& right_thunk, ThreadPoolTempl<ThreadPoolEnv>* thread_pool) {
|
||||||
|
typedef typename ThreadPoolTempl<ThreadPoolEnv>::Task Task;
|
||||||
std::atomic<bool> right_done(false);
|
std::atomic<bool> right_done(false);
|
||||||
auto execute_right = [&right_thunk, &right_done]() {
|
auto execute_right = [&right_thunk, &right_done]() {
|
||||||
std::forward<RightType>(right_thunk)();
|
std::forward<RightType>(right_thunk)();
|
||||||
@ -99,7 +100,7 @@ class ForkJoinScheduler {
|
|||||||
};
|
};
|
||||||
thread_pool->Schedule(execute_right);
|
thread_pool->Schedule(execute_right);
|
||||||
std::forward<LeftType>(left_thunk)();
|
std::forward<LeftType>(left_thunk)();
|
||||||
ThreadPool::Task task;
|
Task task;
|
||||||
while (!right_done.load(std::memory_order_acquire)) {
|
while (!right_done.load(std::memory_order_acquire)) {
|
||||||
thread_pool->MaybeGetTask(&task);
|
thread_pool->MaybeGetTask(&task);
|
||||||
if (task.f) task.f();
|
if (task.f) task.f();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user