Libspinscale: Initial top-level SMO port to coroutine framework

We haven't ported everything. Just the top-level methods. We'll
dig in to the leaf stuff later. Surprisingly, this all went without
any real difficulties.

Runs like a charm on first try.
This commit is contained in:
2026-05-24 16:12:29 -04:00
parent c539e6e924
commit cde2737876
44 changed files with 1296 additions and 1530 deletions
@@ -9,9 +9,9 @@
#include <algorithm>
#include <boost/system/error_code.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <spinscale/asynchronousContinuation.h>
#include <spinscale/asynchronousBridge.h>
#include <spinscale/callback.h>
#include <spinscale/cps/asynchronousContinuation.h>
#include <spinscale/cps/asynchronousBridge.h>
#include <spinscale/cps/callback.h>
#include <spinscale/asynchronousLoop.h>
#include <componentThread.h>
#include <user/stimulusFrame.h>
@@ -229,7 +229,7 @@ void OpenClCollatingAndMeshingEngine::finalize()
int delayMs = std::max(OCLCOLLMESH_ENGN_FINALIZE_DELAY_MS, 0);
auto& ioService = smoHooksPtr->ComponentThread_getSelf()->getIoService();
sscl::AsynchronousBridge bridge(ioService);
sscl::cps::AsynchronousBridge bridge(ioService);
boost::asio::deadline_timer timeoutTimer(ioService);
/** EXPLANATION:
@@ -1008,7 +1008,7 @@ void OpenClCollatingAndMeshingEngine::produceAmbienceStimulusFrame(
}
class OpenClCollatingAndMeshingEngine::CompactCollateAndMeshFrameReq
: public sscl::PostedAsynchronousContinuation<compactCollateAndMeshFrameReqCbFn>
: public sscl::cps::PostedAsynchronousContinuation<compactCollateAndMeshFrameReqCbFn>
{
private:
OpenClCollatingAndMeshingEngine& engine;
@@ -1027,8 +1027,8 @@ public:
std::optional<AmbienceProductionDesc> lightAmbienceProductionDesc_,
std::optional<AmbienceProductionDesc> darkAmbienceProductionDesc_,
const std::shared_ptr<sscl::ComponentThread>& caller,
sscl::Callback<compactCollateAndMeshFrameReqCbFn> cb)
: sscl::PostedAsynchronousContinuation<compactCollateAndMeshFrameReqCbFn>(
sscl::cps::Callback<compactCollateAndMeshFrameReqCbFn> cb)
: sscl::cps::PostedAsynchronousContinuation<compactCollateAndMeshFrameReqCbFn>(
caller, cb),
engine(engine_),
frameAssemblyResult(asyncLoop), stimulusFrame(stimulusFrame_),
@@ -1253,7 +1253,7 @@ void OpenClCollatingAndMeshingEngine::compactCollateAndMeshFrameReq(
std::optional<std::reference_wrapper<StimulusFrame>> intensityStimFrame,
std::optional<AmbienceProductionDesc> lightAmbienceProductionDesc,
std::optional<AmbienceProductionDesc> darkAmbienceProductionDesc,
sscl::Callback<compactCollateAndMeshFrameReqCbFn> callback)
sscl::cps::Callback<compactCollateAndMeshFrameReqCbFn> callback)
{
{
sscl::SpinLock::Guard lock(shouldAcceptRequestsLock);