Core/TaskScheduler: Make implementation private

This commit is contained in:
SirLynix
2024-02-05 15:59:45 +01:00
parent 3eae055d3a
commit a4827a99a0
3 changed files with 55 additions and 72 deletions

View File

@@ -8,9 +8,7 @@
#define NAZARA_CORE_TASKSCHEDULER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <NazaraUtils/MemoryPool.hpp>
#include <Nazara/Core/Config.hpp>
#include <atomic>
#include <functional>
#include <memory>
@@ -28,7 +26,7 @@ namespace Nz
void AddTask(Task&& task);
inline unsigned int GetWorkerCount() const;
unsigned int GetWorkerCount() const;
void WaitForTasks();
@@ -36,17 +34,9 @@ namespace Nz
TaskScheduler& operator=(TaskScheduler&&) = delete;
private:
struct Data;
class Worker;
friend Worker;
Worker& GetWorker(unsigned int workerIndex);
void NotifyTaskCompletion();
std::atomic_uint m_remainingTasks;
std::size_t m_nextWorkerIndex;
std::vector<Worker> m_workers;
MemoryPool<Task> m_tasks;
unsigned int m_workerCount;
std::unique_ptr<Data> m_data;
};
}

View File

@@ -6,10 +6,6 @@
namespace Nz
{
inline unsigned int TaskScheduler::GetWorkerCount() const
{
return m_workerCount;
}
}
#include <Nazara/Core/DebugOff.hpp>