Spinscale: add dynamic coro post-to targeting; test on dev reattacher
This commit is contained in:
+1
-1
Submodule libspinscale updated: 2749d77d65...42076d6c78
@@ -24,8 +24,16 @@ DeviceReattacher::DeviceReattacher(
|
||||
|
||||
mrntt::MrnttNonViralPostingInvoker DeviceReattacher::reattachKnownListCReq(
|
||||
[[maybe_unused]] std::exception_ptr &exceptionPtr,
|
||||
[[maybe_unused]] std::function<void()> callback)
|
||||
[[maybe_unused]] std::function<void()> 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)
|
||||
|
||||
@@ -39,7 +39,8 @@ private:
|
||||
|
||||
mrntt::MrnttNonViralPostingInvoker reattachKnownListCReq(
|
||||
std::exception_ptr &exceptionPtr,
|
||||
std::function<void()> callback);
|
||||
std::function<void()> callback,
|
||||
sscl::co::ExplicitPostTarget postTarget);
|
||||
|
||||
DeviceManager &parent;
|
||||
std::shared_ptr<sscl::ComponentThread> ioThread;
|
||||
|
||||
Reference in New Issue
Block a user