summaryrefslogtreecommitdiffstats
path: root/src/server/Engine.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-04-03 18:23:08 +0200
committerDavid Robillard <d@drobilla.net>2018-04-03 18:23:08 +0200
commit76c3ac8d285deef88f41e6cbba1f3c77a49df179 (patch)
treeb02966fef554acac5924898df8b3d76d35723258 /src/server/Engine.cpp
parent7a5e694c3ffed12532ee2b97f99c4b56dbba4d02 (diff)
downloadingen-76c3ac8d285deef88f41e6cbba1f3c77a49df179.tar.gz
ingen-76c3ac8d285deef88f41e6cbba1f3c77a49df179.tar.bz2
ingen-76c3ac8d285deef88f41e6cbba1f3c77a49df179.zip
WIP: parallel stuffparallel-work
Diffstat (limited to 'src/server/Engine.cpp')
-rw-r--r--src/server/Engine.cpp11
1 files changed, 6 insertions, 5 deletions
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<Store>