Issue #11 Improve CEventLoop API

This commit is contained in:
Mat Sutcliffe
2021-09-28 18:34:25 +01:00
parent 3bd4b47d65
commit 002cd1d5b9
4 changed files with 38 additions and 41 deletions

View File

@@ -426,11 +426,12 @@ namespace BlackCore
CStatusMessageList CApplication::waitForSetup(int timeoutMs)
{
if (!m_setupReader) { return CStatusMessage(this).error(u"No setup reader"); }
CEventLoop::processEventsUntil(this, &CApplication::setupHandlingCompleted, timeoutMs, [this]
CEventLoop eventLoop;
eventLoop.stopWhen(this, &CApplication::setupHandlingCompleted);
if (!m_setupReader->isSetupAvailable())
{
// init, if this is true event queue is not started
return m_setupReader->isSetupAvailable();
});
eventLoop.exec(timeoutMs);
}
// setup handling completed with success or failure, or we run into time out
CStatusMessageList msgs;