From cb7570b1cc8364481550eca1447cd6a140b31aa7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 9 Jan 2023 11:18:07 +0200 Subject: [PATCH] Don't busyloop while waiting for an internal task to complete --- source/lib/internaltask.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.45.2