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
+10 -4
View File
@@ -8,7 +8,8 @@
#include <dlfcn.h>
#include <functional>
#include <user/senseApiDesc.h>
#include <spinscale/qutex.h>
#include <spinscale/co/coQutex.h>
#include <spinscale/sharedResourceGroup.h>
namespace smo {
namespace stim_buff {
@@ -31,10 +32,11 @@ public:
StimBuffApiLib(
const std::string& path, void *_dlopen_handle,
SMO_GET_STIM_BUFF_API_DESC_FN_TYPEDEF *descFn)
: libraryPath(path), qutex("StimBuffApiLib-" + path),
: libraryPath(path),
isBeingDestroyed(false),
dlopen_handle(_dlopen_handle, DlCloser()),
SMO_GET_STIM_BUFF_API_DESC_FN_NAME(descFn)
SMO_GET_STIM_BUFF_API_DESC_FN_NAME(descFn),
s("StimBuffApiLib-" + path)
{}
void setStimBuffApiDesc(const StimBuffApiDesc &desc)
@@ -51,7 +53,6 @@ public:
public:
std::string libraryPath;
sscl::Qutex qutex;
std::atomic<bool> isBeingDestroyed;
std::unique_ptr<void, DlCloser> dlopen_handle;
/* UNIMPLEMENTED: API-specific cmdline options. These affect this specific
@@ -77,6 +78,11 @@ public:
*/
StimBuffApiDesc stimBuffApiDesc;
struct StimBuffApiLibResources
{};
sscl::SharedResourceGroup<sscl::co::CoQutex, StimBuffApiLibResources> s;
std::string stringify() const {
std::string result = "Library Path: " + libraryPath + "\n";
result += "Stim Buff API Descriptor: " + stimBuffApiDesc.stringify() + "\n";