mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Issue #11 Improve CEventLoop API
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user