SenseApiDesc,xcbWindow: port to sscl coro framework
SenseApiDesc's exported API now uses coro pointers instead of CPS fn pointers. * Do not build this version of SMO with the Livox drivers enabled, because SMO has been changed at the smocore level to use coros when calling into stimbuffAPI libs. But the Livox drivers haven't yet been ported from CPS to coros. xcbWindow has been ported to expose coros to SMO in its senseApiDesc exported iface.
This commit is contained in:
@@ -55,8 +55,8 @@ BodyViralPostingInvoker<bool> Body::initializeCReq()
|
||||
std::cout << __func__ << ": About to initializeAllStimBuffApiLibs"
|
||||
<< '\n';
|
||||
}
|
||||
stim_buff::StimBuffApiManager::getInstance()
|
||||
.initializeAllStimBuffApiLibs();
|
||||
co_await stim_buff::StimBuffApiManager::getInstance()
|
||||
.initializeAllStimBuffApiLibsCReq();
|
||||
|
||||
if (OptionParser::getOptions().verbose)
|
||||
{
|
||||
@@ -100,7 +100,8 @@ BodyViralPostingInvoker<bool> Body::finalizeCReq()
|
||||
<< " sense devices." << "\n";
|
||||
|
||||
std::cout << "Mrntt: About to finalize all stim buff api libs." << "\n";
|
||||
stim_buff::StimBuffApiManager::getInstance().finalizeAllStimBuffApiLibs();
|
||||
co_await stim_buff::StimBuffApiManager::getInstance()
|
||||
.finalizeAllStimBuffApiLibsCReq();
|
||||
|
||||
std::cout << "Mrntt: About to unload all stim buff api libs." << "\n";
|
||||
stim_buff::StimBuffApiManager::getInstance().unloadAllStimBuffApiLibs();
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <memory>
|
||||
#include <opts.h>
|
||||
#include <componentThread.h>
|
||||
#include <cpsBoundary/stimBuffDeviceAReq.h>
|
||||
#include <deviceManager/deviceManager.h>
|
||||
#include <deviceManager/deviceReattacher.h>
|
||||
#include <stimBuffApis/stimBuffApiManager.h>
|
||||
@@ -33,11 +32,6 @@ void assertMarionetteThread()
|
||||
}
|
||||
}
|
||||
|
||||
boost::asio::io_service &marionetteIoService()
|
||||
{
|
||||
return mrntt::MrnttThreadTag::io_service();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
DeviceManager::~DeviceManager()
|
||||
@@ -55,7 +49,7 @@ const std::string DeviceManager::stringifyDeviceSpecs(void)
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
mrntt::MrnttViralPostingInvoker<cpsBoundary::StimBuffDeviceOpResult>
|
||||
mrntt::MrnttViralPostingInvoker<stim_buff::StimBuffDeviceOpResult>
|
||||
DeviceManager::attachStimBuffDeviceCReq(
|
||||
const std::shared_ptr<DeviceAttachmentSpec>& spec)
|
||||
{
|
||||
@@ -67,7 +61,7 @@ DeviceManager::attachStimBuffDeviceCReq(
|
||||
{
|
||||
std::cerr << "attachStimBuffDeviceCReq: No library found for API '"
|
||||
<< spec->stimBuffApi << "'" << std::endl;
|
||||
co_return cpsBoundary::StimBuffDeviceOpResult{false, spec};
|
||||
co_return stim_buff::StimBuffDeviceOpResult{false, spec};
|
||||
}
|
||||
|
||||
auto &lib = *libOpt.value();
|
||||
@@ -76,15 +70,15 @@ DeviceManager::attachStimBuffDeviceCReq(
|
||||
{
|
||||
std::cerr << std::string(__func__) + ": Library is being destroyed"
|
||||
<< " for API '" << spec->stimBuffApi << "'. Bailing out.\n";
|
||||
co_return cpsBoundary::StimBuffDeviceOpResult{false, spec};
|
||||
co_return stim_buff::StimBuffDeviceOpResult{false, spec};
|
||||
}
|
||||
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.attachDeviceReq)
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.attachDeviceCReq)
|
||||
{
|
||||
std::cerr << std::string(__func__) + ": attachDeviceReq() is NULL "
|
||||
std::cerr << std::string(__func__) + ": attachDeviceCReq() is NULL "
|
||||
"for library '" << lib.libraryPath << "'"
|
||||
<< std::endl;
|
||||
co_return cpsBoundary::StimBuffDeviceOpResult{false, spec};
|
||||
co_return stim_buff::StimBuffDeviceOpResult{false, spec};
|
||||
}
|
||||
|
||||
sscl::co::CoQutex::ReleaseHandle sbamGuard =
|
||||
@@ -114,14 +108,11 @@ DeviceManager::attachStimBuffDeviceCReq(
|
||||
<< spec->deviceIdentifier << " to body thread" << "\n";
|
||||
}
|
||||
|
||||
cpsBoundary::StimBuffDeviceOpResult result = co_await
|
||||
cpsBoundary::AttachStimBuffDeviceAReq(
|
||||
spec, lib, threadForAttachment, marionetteIoService());
|
||||
|
||||
co_return result;
|
||||
co_return co_await lib.stimBuffApiDesc.sal_mgmt_libOps.attachDeviceCReq(
|
||||
spec, threadForAttachment);
|
||||
}
|
||||
|
||||
mrntt::MrnttViralPostingInvoker<cpsBoundary::StimBuffDeviceOpResult>
|
||||
mrntt::MrnttViralPostingInvoker<stim_buff::StimBuffDeviceOpResult>
|
||||
DeviceManager::detachStimBuffDeviceCReq(
|
||||
const std::shared_ptr<DeviceAttachmentSpec>& spec)
|
||||
{
|
||||
@@ -133,7 +124,7 @@ DeviceManager::detachStimBuffDeviceCReq(
|
||||
{
|
||||
std::cerr << "detachStimBuffDeviceCReq: No library found for API '"
|
||||
<< spec->stimBuffApi << "'" << std::endl;
|
||||
co_return cpsBoundary::StimBuffDeviceOpResult{false, spec};
|
||||
co_return stim_buff::StimBuffDeviceOpResult{false, spec};
|
||||
}
|
||||
|
||||
auto &lib = *libOpt.value();
|
||||
@@ -142,15 +133,15 @@ DeviceManager::detachStimBuffDeviceCReq(
|
||||
{
|
||||
std::cerr << std::string(__func__) + ": Library is being destroyed"
|
||||
<< " for API '" << spec->stimBuffApi << "'. Bailing out.\n";
|
||||
co_return cpsBoundary::StimBuffDeviceOpResult{false, spec};
|
||||
co_return stim_buff::StimBuffDeviceOpResult{false, spec};
|
||||
}
|
||||
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.detachDeviceReq)
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.detachDeviceCReq)
|
||||
{
|
||||
std::cerr << std::string(__func__) + ": detachDeviceReq() is NULL "
|
||||
std::cerr << std::string(__func__) + ": detachDeviceCReq() is NULL "
|
||||
"for library '" << lib.libraryPath << "'"
|
||||
<< std::endl;
|
||||
co_return cpsBoundary::StimBuffDeviceOpResult{false, spec};
|
||||
co_return stim_buff::StimBuffDeviceOpResult{false, spec};
|
||||
}
|
||||
|
||||
sscl::co::CoQutex::ReleaseHandle sbamGuard =
|
||||
@@ -159,11 +150,8 @@ DeviceManager::detachStimBuffDeviceCReq(
|
||||
co_await lib.s.lock.getAcquireInvocationAndSuspensionPolicy();
|
||||
sbamGuard.release();
|
||||
|
||||
cpsBoundary::StimBuffDeviceOpResult result = co_await
|
||||
cpsBoundary::DetachStimBuffDeviceAReq(
|
||||
spec, lib, marionetteIoService());
|
||||
|
||||
co_return result;
|
||||
co_return co_await lib.stimBuffApiDesc.sal_mgmt_libOps.detachDeviceCReq(
|
||||
spec);
|
||||
}
|
||||
|
||||
mrntt::MrnttViralPostingInvoker<DeviceManager::DeviceAttachmentIndResult>
|
||||
@@ -243,7 +231,7 @@ DeviceManager::newDeviceAttachmentSpecIndCReq(
|
||||
true, existingDeviceRole, specPtr};
|
||||
}
|
||||
|
||||
cpsBoundary::StimBuffDeviceOpResult attachResult =
|
||||
stim_buff::StimBuffDeviceOpResult attachResult =
|
||||
co_await attachStimBuffDeviceCReq(specPtr);
|
||||
|
||||
if (!attachResult.success)
|
||||
@@ -295,7 +283,7 @@ DeviceManager::removeDeviceAttachmentSpecCReq(
|
||||
}
|
||||
|
||||
// Call detachStimBuffDeviceCReq first - only clean up metadata if this succeeds
|
||||
cpsBoundary::StimBuffDeviceOpResult detachResult =
|
||||
stim_buff::StimBuffDeviceOpResult detachResult =
|
||||
co_await detachStimBuffDeviceCReq(specPtr);
|
||||
|
||||
if (!detachResult.success)
|
||||
@@ -473,7 +461,7 @@ DeviceManager::detachAllAttachedDeviceRolesCReq()
|
||||
|
||||
sscl::co::Group group;
|
||||
std::vector<
|
||||
mrntt::MrnttViralPostingInvoker<cpsBoundary::StimBuffDeviceOpResult>>
|
||||
mrntt::MrnttViralPostingInvoker<stim_buff::StimBuffDeviceOpResult>>
|
||||
invokers;
|
||||
invokers.reserve(specsToDetach.size());
|
||||
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
#ifndef STIM_BUFF_DEVICE_AREQ_H
|
||||
#define STIM_BUFF_DEVICE_AREQ_H
|
||||
|
||||
#include <atomic>
|
||||
#include <coroutine>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <spinscale/cps/callback.h>
|
||||
#include <stimBuffApis/stimBuffApiLib.h>
|
||||
#include <user/deviceAttachmentSpec.h>
|
||||
#include <user/senseApiDesc.h>
|
||||
|
||||
namespace smo {
|
||||
namespace cpsBoundary {
|
||||
|
||||
struct StimBuffDeviceOpResult
|
||||
{
|
||||
bool success = false;
|
||||
std::shared_ptr<device::DeviceAttachmentSpec> deviceSpec;
|
||||
};
|
||||
|
||||
struct AttachStimBuffDeviceAReq
|
||||
{
|
||||
struct AsyncState
|
||||
{
|
||||
std::atomic<bool> settled{false};
|
||||
StimBuffDeviceOpResult result;
|
||||
std::coroutine_handle<> callerSchedHandle;
|
||||
};
|
||||
|
||||
AttachStimBuffDeviceAReq(
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec> &spec,
|
||||
stim_buff::StimBuffApiLib &lib,
|
||||
const std::shared_ptr<sscl::ComponentThread> &threadForAttachment,
|
||||
boost::asio::io_service &resumeIoService)
|
||||
: asyncState(std::make_shared<AsyncState>()),
|
||||
resumeIoService(resumeIoService)
|
||||
{
|
||||
lib.stimBuffApiDesc.sal_mgmt_libOps.attachDeviceReq(
|
||||
spec, threadForAttachment,
|
||||
{nullptr,
|
||||
[asyncState = asyncState, &resumeIoService = resumeIoService](
|
||||
bool success,
|
||||
std::shared_ptr<device::DeviceAttachmentSpec> deviceSpec)
|
||||
{
|
||||
asyncState->result = StimBuffDeviceOpResult{
|
||||
success, deviceSpec};
|
||||
|
||||
asyncState->settled.store(
|
||||
true, std::memory_order_release);
|
||||
|
||||
std::coroutine_handle<> handle =
|
||||
asyncState->callerSchedHandle;
|
||||
|
||||
if (!handle) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::asio::post(
|
||||
resumeIoService,
|
||||
[handle]() { handle.resume(); });
|
||||
}});
|
||||
}
|
||||
|
||||
bool await_ready() const noexcept
|
||||
{
|
||||
return asyncState->settled.load(std::memory_order_acquire);
|
||||
}
|
||||
|
||||
bool await_suspend(std::coroutine_handle<> callerSchedHandle) noexcept
|
||||
{
|
||||
if (asyncState->settled.load(std::memory_order_acquire)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
asyncState->callerSchedHandle = callerSchedHandle;
|
||||
return true;
|
||||
}
|
||||
|
||||
StimBuffDeviceOpResult await_resume() noexcept
|
||||
{
|
||||
return asyncState->result;
|
||||
}
|
||||
|
||||
std::shared_ptr<AsyncState> asyncState;
|
||||
boost::asio::io_service &resumeIoService;
|
||||
};
|
||||
|
||||
struct DetachStimBuffDeviceAReq
|
||||
{
|
||||
struct AsyncState
|
||||
{
|
||||
std::atomic<bool> settled{false};
|
||||
StimBuffDeviceOpResult result;
|
||||
std::coroutine_handle<> callerSchedHandle;
|
||||
};
|
||||
|
||||
DetachStimBuffDeviceAReq(
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec> &spec,
|
||||
stim_buff::StimBuffApiLib &lib,
|
||||
boost::asio::io_service &resumeIoService)
|
||||
: asyncState(std::make_shared<AsyncState>()),
|
||||
resumeIoService(resumeIoService)
|
||||
{
|
||||
lib.stimBuffApiDesc.sal_mgmt_libOps.detachDeviceReq(
|
||||
spec,
|
||||
{nullptr,
|
||||
[asyncState = asyncState, &resumeIoService = resumeIoService](
|
||||
bool success,
|
||||
std::shared_ptr<device::DeviceAttachmentSpec> deviceSpec)
|
||||
{
|
||||
asyncState->result = StimBuffDeviceOpResult{
|
||||
success, deviceSpec};
|
||||
|
||||
asyncState->settled.store(
|
||||
true, std::memory_order_release);
|
||||
|
||||
std::coroutine_handle<> handle =
|
||||
asyncState->callerSchedHandle;
|
||||
|
||||
if (!handle) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::asio::post(
|
||||
resumeIoService,
|
||||
[handle]() { handle.resume(); });
|
||||
}});
|
||||
}
|
||||
|
||||
bool await_ready() const noexcept
|
||||
{
|
||||
return asyncState->settled.load(std::memory_order_acquire);
|
||||
}
|
||||
|
||||
bool await_suspend(std::coroutine_handle<> callerSchedHandle) noexcept
|
||||
{
|
||||
if (asyncState->settled.load(std::memory_order_acquire)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
asyncState->callerSchedHandle = callerSchedHandle;
|
||||
return true;
|
||||
}
|
||||
|
||||
StimBuffDeviceOpResult await_resume() noexcept
|
||||
{
|
||||
return asyncState->result;
|
||||
}
|
||||
|
||||
std::shared_ptr<AsyncState> asyncState;
|
||||
boost::asio::io_service &resumeIoService;
|
||||
};
|
||||
|
||||
} // namespace cpsBoundary
|
||||
} // namespace smo
|
||||
|
||||
#endif // STIM_BUFF_DEVICE_AREQ_H
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <deviceManager/device.h>
|
||||
#include <deviceManager/deviceRole.h>
|
||||
#include <deviceManager/deviceReattacher.h>
|
||||
#include <cpsBoundary/stimBuffDeviceAReq.h>
|
||||
#include <marionette/marionetteThread.h>
|
||||
#include <spinscale/co/coQutex.h>
|
||||
#include <spinscale/multiOperationResultSet.h>
|
||||
@@ -59,11 +58,11 @@ public:
|
||||
mrntt::MrnttViralPostingInvoker<DeviceAttachmentIndResult>
|
||||
removeDeviceAttachmentSpecCReq(const DeviceAttachmentSpec &spec);
|
||||
|
||||
mrntt::MrnttViralPostingInvoker<cpsBoundary::StimBuffDeviceOpResult>
|
||||
mrntt::MrnttViralPostingInvoker<stim_buff::StimBuffDeviceOpResult>
|
||||
attachStimBuffDeviceCReq(
|
||||
const std::shared_ptr<DeviceAttachmentSpec>& spec);
|
||||
|
||||
mrntt::MrnttViralPostingInvoker<cpsBoundary::StimBuffDeviceOpResult>
|
||||
mrntt::MrnttViralPostingInvoker<stim_buff::StimBuffDeviceOpResult>
|
||||
detachStimBuffDeviceCReq(
|
||||
const std::shared_ptr<DeviceAttachmentSpec>& spec);
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <functional>
|
||||
#include <stimBuffApis/stimBuffApiLib.h>
|
||||
#include <user/deviceAttachmentSpec.h>
|
||||
#include <body/bodyThread.h>
|
||||
#include <spinscale/co/coQutex.h>
|
||||
#include <spinscale/sharedResourceGroup.h>
|
||||
|
||||
@@ -44,15 +45,18 @@ public:
|
||||
const std::string& apiName);
|
||||
void unloadStimBuffApiLib(const std::string& libraryPath);
|
||||
|
||||
void initializeStimBuffApiLib(StimBuffApiLib& lib);
|
||||
void finalizeStimBuffApiLib(StimBuffApiLib& lib);
|
||||
|
||||
void loadAllStimBuffApiLibsFromOptions(
|
||||
const std::shared_ptr<sscl::ComponentThread>& componentThread);
|
||||
|
||||
void unloadAllStimBuffApiLibs(void);
|
||||
void initializeAllStimBuffApiLibs(void);
|
||||
void finalizeAllStimBuffApiLibs(void);
|
||||
|
||||
body::BodyViralPostingInvoker<void> initializeStimBuffApiLibCReq(
|
||||
StimBuffApiLib &lib, bool acquireSbamLock);
|
||||
body::BodyViralPostingInvoker<void> finalizeStimBuffApiLibCReq(
|
||||
StimBuffApiLib &lib, bool acquireSbamLock);
|
||||
|
||||
body::BodyViralPostingInvoker<void> initializeAllStimBuffApiLibsCReq();
|
||||
body::BodyViralPostingInvoker<void> finalizeAllStimBuffApiLibsCReq();
|
||||
|
||||
std::string stringifyLibs() const;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <filesystem>
|
||||
#include <stimBuffApis/stimBuffApiManager.h>
|
||||
#include <stimBuffApis/stimBuffApiLib.h>
|
||||
#include <body/bodyThread.h>
|
||||
#include <componentThread.h>
|
||||
#include <opts.h>
|
||||
#include <user/senseApiDesc.h>
|
||||
#include <mind.h>
|
||||
@@ -17,6 +19,21 @@ namespace fs = std::filesystem;
|
||||
namespace smo {
|
||||
namespace stim_buff {
|
||||
|
||||
namespace {
|
||||
|
||||
void assertBodyThread()
|
||||
{
|
||||
auto self = sscl::ComponentThread::getSelf();
|
||||
if (self->id != SmoThreadId::BODY)
|
||||
{
|
||||
throw std::runtime_error(
|
||||
std::string(__func__)
|
||||
+ ": Must be executed on Body thread");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
/**
|
||||
* @brief Searches for a library in predefined locations
|
||||
* @param libraryPath The name or path of the library to find
|
||||
@@ -269,49 +286,96 @@ std::string StimBuffApiManager::stringifyLibs() const
|
||||
return result;
|
||||
}
|
||||
|
||||
void StimBuffApiManager::initializeStimBuffApiLib(StimBuffApiLib& lib)
|
||||
body::BodyViralPostingInvoker<void>
|
||||
StimBuffApiManager::initializeStimBuffApiLibCReq(
|
||||
StimBuffApiLib &lib, bool acquireSbamLock)
|
||||
{
|
||||
/** FIXME:
|
||||
* When we eventually make this method async, this method should acquire
|
||||
* the StimBuffApiManager's main CRUD qutex.
|
||||
*/
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.initializeInd)
|
||||
{
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) + ": initializeInd() is NULL for library '"
|
||||
+ lib.libraryPath + "'");
|
||||
}
|
||||
lib.stimBuffApiDesc.sal_mgmt_libOps.initializeInd();
|
||||
assertBodyThread();
|
||||
|
||||
StimBuffApiManager &sbam = getInstance();
|
||||
std::optional<sscl::co::CoQutex::ReleaseHandle> sbamGuard;
|
||||
if (acquireSbamLock)
|
||||
{
|
||||
sbamGuard.emplace(
|
||||
co_await sbam.s.lock.getAcquireInvocationAndSuspensionPolicy());
|
||||
}
|
||||
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.initializeCInd)
|
||||
{
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) + ": initializeCInd() is NULL for library '"
|
||||
+ lib.libraryPath + "'");
|
||||
}
|
||||
|
||||
sscl::co::CoQutex::ReleaseHandle libGuard =
|
||||
co_await lib.s.lock.getAcquireInvocationAndSuspensionPolicy();
|
||||
|
||||
co_await lib.stimBuffApiDesc.sal_mgmt_libOps.initializeCInd();
|
||||
|
||||
co_return;
|
||||
}
|
||||
|
||||
void StimBuffApiManager::finalizeStimBuffApiLib(StimBuffApiLib& lib)
|
||||
body::BodyViralPostingInvoker<void>
|
||||
StimBuffApiManager::finalizeStimBuffApiLibCReq(
|
||||
StimBuffApiLib &lib, bool acquireSbamLock)
|
||||
{
|
||||
/** FIXME:
|
||||
* When we eventually make this method async, this flag should only be set
|
||||
* after acquiring the StimBuffApiManager's main CRUD qutex.
|
||||
*/
|
||||
lib.isBeingDestroyed.store(true);
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.finalizeInd)
|
||||
{
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) + ": finalizeInd() is NULL for library '"
|
||||
+ lib.libraryPath + "'");
|
||||
}
|
||||
lib.stimBuffApiDesc.sal_mgmt_libOps.finalizeInd();
|
||||
assertBodyThread();
|
||||
|
||||
StimBuffApiManager &sbam = getInstance();
|
||||
std::optional<sscl::co::CoQutex::ReleaseHandle> sbamGuard;
|
||||
if (acquireSbamLock)
|
||||
{
|
||||
sbamGuard.emplace(
|
||||
co_await sbam.s.lock.getAcquireInvocationAndSuspensionPolicy());
|
||||
}
|
||||
|
||||
lib.isBeingDestroyed.store(true);
|
||||
|
||||
if (!lib.stimBuffApiDesc.sal_mgmt_libOps.finalizeCInd)
|
||||
{
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) + ": finalizeCInd() is NULL for library '"
|
||||
+ lib.libraryPath + "'");
|
||||
}
|
||||
|
||||
sscl::co::CoQutex::ReleaseHandle libGuard =
|
||||
co_await lib.s.lock.getAcquireInvocationAndSuspensionPolicy();
|
||||
|
||||
co_await lib.stimBuffApiDesc.sal_mgmt_libOps.finalizeCInd();
|
||||
|
||||
co_return;
|
||||
}
|
||||
|
||||
void StimBuffApiManager::initializeAllStimBuffApiLibs(void)
|
||||
body::BodyViralPostingInvoker<void>
|
||||
StimBuffApiManager::initializeAllStimBuffApiLibsCReq()
|
||||
{
|
||||
for (auto& lib : getInstance().s.rsrc.stimBuffApiLibs) {
|
||||
initializeStimBuffApiLib(*lib);
|
||||
}
|
||||
assertBodyThread();
|
||||
|
||||
StimBuffApiManager &sbam = getInstance();
|
||||
sscl::co::CoQutex::ReleaseHandle sbamGuard =
|
||||
co_await sbam.s.lock.getAcquireInvocationAndSuspensionPolicy();
|
||||
|
||||
for (auto &lib : sbam.s.rsrc.stimBuffApiLibs) {
|
||||
co_await initializeStimBuffApiLibCReq(*lib, false);
|
||||
}
|
||||
|
||||
co_return;
|
||||
}
|
||||
|
||||
void StimBuffApiManager::finalizeAllStimBuffApiLibs(void)
|
||||
body::BodyViralPostingInvoker<void>
|
||||
StimBuffApiManager::finalizeAllStimBuffApiLibsCReq()
|
||||
{
|
||||
for (auto& lib : getInstance().s.rsrc.stimBuffApiLibs) {
|
||||
finalizeStimBuffApiLib(*lib);
|
||||
}
|
||||
assertBodyThread();
|
||||
|
||||
StimBuffApiManager &sbam = getInstance();
|
||||
sscl::co::CoQutex::ReleaseHandle sbamGuard =
|
||||
co_await sbam.s.lock.getAcquireInvocationAndSuspensionPolicy();
|
||||
|
||||
for (auto &lib : sbam.s.rsrc.stimBuffApiLibs) {
|
||||
co_await finalizeStimBuffApiLibCReq(*lib, false);
|
||||
}
|
||||
|
||||
co_return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user