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