Mrntt:lifetime: if no devs attach, fail initializeCReq
This commit is contained in:
@@ -64,6 +64,8 @@ private:
|
||||
public:
|
||||
std::exception_ptr initializeLifetimeExceptionPtr;
|
||||
std::exception_ptr finalizeLifetimeExceptionPtr;
|
||||
/** Set true only when initializeCReq completes without failure. */
|
||||
bool initializeLifetimeSucceeded = false;
|
||||
};
|
||||
|
||||
extern std::shared_ptr<sscl::PuppeteerThread> thread;
|
||||
|
||||
@@ -31,6 +31,8 @@ void assertMarionetteThread()
|
||||
void MarionetteComponent::holdInitializeCReq(
|
||||
std::function<void()> completion)
|
||||
{
|
||||
initializeLifetimeSucceeded = false;
|
||||
initializeLifetimeExceptionPtr = nullptr;
|
||||
initializeCReqInvoker.emplace(initializeCReq(
|
||||
initializeLifetimeExceptionPtr, std::move(completion)));
|
||||
}
|
||||
@@ -58,6 +60,7 @@ MrnttNonViralPostingInvoker MarionetteComponent::initializeCReq(
|
||||
co_return;
|
||||
}
|
||||
|
||||
initializeLifetimeSucceeded = true;
|
||||
smo::device::DeviceManager::getInstance().initializeDeviceReattacher();
|
||||
|
||||
// Call negtrinEventInd on the Director in the final callback
|
||||
|
||||
@@ -133,7 +133,8 @@ void MarionetteComponent::preLoopHook()
|
||||
[]
|
||||
{
|
||||
marionetteInitializeReqCb(
|
||||
!mrntt.initializeLifetimeExceptionPtr);
|
||||
mrntt.initializeLifetimeSucceeded
|
||||
&& !mrntt.initializeLifetimeExceptionPtr);
|
||||
});
|
||||
|
||||
std::cout << "PuppeteerThread::main: Entering event loop" << "\n";
|
||||
|
||||
Reference in New Issue
Block a user