From fc83627b14536d0b13b2dd751d09cecbea9db378 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 29 Sep 2020 02:06:41 +0200 Subject: move thread init into arch/ --- lib/executor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/executor.cc') diff --git a/lib/executor.cc b/lib/executor.cc index 8977ee3..175d7a5 100644 --- a/lib/executor.cc +++ b/lib/executor.cc @@ -2,7 +2,7 @@ #include "executor.h" -#include "arch/x86_64/asm.h" +#include "arch/x86_64/api.h" namespace nMatcha { void Executor::spawn(std::unique_ptr t) { @@ -11,13 +11,13 @@ namespace nMatcha { } void Executor::run() { + // Round robin until all threads finished. while (!mThreads.empty()) { for (const std::unique_ptr& t : mThreads) { if (!t->isFinished()) { yield_to(t.get()); } } - mThreads.remove_if([](const std::unique_ptr& t) { return t->isFinished(); }); } } -- cgit v1.2.3