From: Mikko Rasa Date: Mon, 9 Jan 2023 09:18:07 +0000 (+0200) Subject: Don't busyloop while waiting for an internal task to complete X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=cb7570b1cc8364481550eca1447cd6a140b31aa7;p=builder.git Don't busyloop while waiting for an internal task to complete --- diff --git a/source/lib/internaltask.cpp b/source/lib/internaltask.cpp index fe3ae9d..101534c 100644 --- a/source/lib/internaltask.cpp +++ b/source/lib/internaltask.cpp @@ -1,5 +1,8 @@ +#include #include "internaltask.h" +using namespace Msp; + InternalTask::~InternalTask() { worker.join(); @@ -22,7 +25,8 @@ Task::Status InternalTask::check() Task::Status InternalTask::wait() { Status result; - while((result = check())==RUNNING) ; + while((result = check())==RUNNING) + Time::sleep(10*Time::msec); return result; }