From d48d9f51970bd90ef9f1a8cbcf6207041e79a104 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Wed, 23 Jan 2019 17:02:24 +0100 Subject: Fix bug in RAII jobs, debug session on ts3 --- engine/include/core/priority.hpp | 2 +- engine/include/core/task.hpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'engine/include/core') diff --git a/engine/include/core/priority.hpp b/engine/include/core/priority.hpp index 1219d26..d6c9b35 100644 --- a/engine/include/core/priority.hpp +++ b/engine/include/core/priority.hpp @@ -33,7 +33,7 @@ namespace flat { return lhs.priority() < rhs.priority(); } - bool operator()(const std::weak_ptr lhs, const std::weak_ptr& rhs) { + bool operator()(const std::weak_ptr lhs, const std::weak_ptr rhs) { if (auto l = lhs.lock()) { if (auto r = rhs.lock()) { // if both valid, check their priority diff --git a/engine/include/core/task.hpp b/engine/include/core/task.hpp index d886fcd..570e547 100644 --- a/engine/include/core/task.hpp +++ b/engine/include/core/task.hpp @@ -24,9 +24,13 @@ namespace flat { callback m_callback; }; - struct job : private queue> { + struct job : public queue> { std::shared_ptr make_task(task::callback f, priority_t p = priority_t::none); void invoke_tasks(); + + inline void operator()() { + invoke_tasks(); + } }; } } -- cgit v1.2.1