From 76c3ac8d285deef88f41e6cbba1f3c77a49df179 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 3 Apr 2018 18:23:08 +0200 Subject: WIP: parallel stuff --- src/server/Engine.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/server/Engine.cpp') diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index fba7c7a3..b05fa75c 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -254,7 +254,7 @@ Engine::signal_tasks_available() _tasks_available.notify_all(); } -Task* +Job Engine::steal_task(unsigned start_thread) { for (unsigned i = 0; i < _run_contexts.size(); ++i) { @@ -262,13 +262,14 @@ Engine::steal_task(unsigned start_thread) RunContext* const ctx = _run_contexts[id]; ParTask* par = ctx->task(); if (par) { - Task* t = steal(*par, *ctx); - if (t) { - return t; + Job job = steal(*par, *ctx); + if (job.task) { + return job; } } } - return nullptr; + + return Job{nullptr, nullptr}; } SPtr -- cgit v1.2.1