AronaCore/core/misc/taskflow_singleton.h

15 lines
350 B
C++

#pragma once
#include "taskflow/taskflow.hpp"
inline tf::Executor* g_executor = nullptr;
inline void init_taskflow() {
g_executor = new tf::Executor(std::thread::hardware_concurrency());
}
inline void release_taskflow() {
if (g_executor) {
g_executor->wait_for_all();
delete g_executor;
g_executor = nullptr;
}
}