Mrntt:lifetime: if no devs attach, fail initializeCReq

This commit is contained in:
2026-05-25 08:50:25 -04:00
parent baa9b7b499
commit b5fa20a2b8
3 changed files with 7 additions and 1 deletions
+2
View File
@@ -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;
+3
View File
@@ -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
+2 -1
View File
@@ -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";