diff --git a/libspinscale b/libspinscale index 2749d77..42076d6 160000 --- a/libspinscale +++ b/libspinscale @@ -1 +1 @@ -Subproject commit 2749d77d651975a54095a2ea023aa3303e584a50 +Subproject commit 42076d6c780a69fb3f645e271adcfb5111c64e0e diff --git a/smocore/deviceManager/deviceReattacher.cpp b/smocore/deviceManager/deviceReattacher.cpp index 9c75a27..8fe9b0a 100644 --- a/smocore/deviceManager/deviceReattacher.cpp +++ b/smocore/deviceManager/deviceReattacher.cpp @@ -24,8 +24,16 @@ DeviceReattacher::DeviceReattacher( mrntt::MrnttNonViralPostingInvoker DeviceReattacher::reattachKnownListCReq( [[maybe_unused]] std::exception_ptr &exceptionPtr, - [[maybe_unused]] std::function callback) + [[maybe_unused]] std::function callback, + [[maybe_unused]] sscl::co::ExplicitPostTarget postTarget) { + /** EXPLANATION: + * DeviceManager attach APIs require the marionette thread; postTarget + * selects where this coroutine runs (mrntt io_context). Completion still + * posts back to the mrntt timer thread via callerIoContext. + */ + (void)postTarget; + sscl::MultiOperationResultSet results = co_await parent.attachAllUnattachedDevicesFromKnownListCReq(); if (results.nTotal > 0) @@ -89,7 +97,8 @@ void DeviceReattacher::holdReattachCReq() { sscl::SpinLock::Guard guard(deviceReattacherCanceler.s.lock); reattachOpInFlight = false; - })); + }, + sscl::co::ExplicitPostTarget{ioThread->getIoContext()})); } void DeviceReattacher::onTimeout(const boost::system::error_code& error) diff --git a/smocore/include/deviceManager/deviceReattacher.h b/smocore/include/deviceManager/deviceReattacher.h index bea42e0..c3a542c 100644 --- a/smocore/include/deviceManager/deviceReattacher.h +++ b/smocore/include/deviceManager/deviceReattacher.h @@ -39,7 +39,8 @@ private: mrntt::MrnttNonViralPostingInvoker reattachKnownListCReq( std::exception_ptr &exceptionPtr, - std::function callback); + std::function callback, + sscl::co::ExplicitPostTarget postTarget); DeviceManager &parent; std::shared_ptr ioThread;