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
View File
@@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <spinscale/qutex.h>
#include <spinscale/lockerAndInvokerBase.h>
#include <spinscale/cps/qutex.h>
#include <spinscale/cps/lockerAndInvokerBase.h>
#include <memory>
#include <thread>
#include <chrono>
@@ -9,18 +9,18 @@
namespace smo {
// Mock implementation of LockerAndInvokerBase for testing
class MockLockerAndInvoker : public LockerAndInvokerBase {
class MockLockerAndInvoker : public sscl::cps::LockerAndInvokerBase {
public:
explicit MockLockerAndInvoker(const void* addr)
: LockerAndInvokerBase(addr), awakened(false) {}
: sscl::cps::LockerAndInvokerBase(addr), awakened(false) {}
bool awakened;
sscl::Qutex* registeredQutex = nullptr;
List::iterator queueIterator;
sscl::cps::Qutex* registeredQutex = nullptr;
sscl::cps::LockerAndInvokerBase::List::iterator queueIterator;
List::iterator getLockvokerIteratorForQutex(sscl::Qutex& qutex) override {
sscl::cps::LockerAndInvokerBase::List::iterator getLockvokerIteratorForQutex(sscl::cps::Qutex& qutex) override {
registeredQutex = &qutex;
queueIterator = qutex.registerInQueue(std::shared_ptr<LockerAndInvokerBase>(this));
queueIterator = qutex.registerInQueue(std::shared_ptr<sscl::cps::LockerAndInvokerBase>(this));
return queueIterator;
}
@@ -44,7 +44,7 @@ protected:
// Clean up
}
sscl::Qutex qutex;
sscl::cps::Qutex qutex;
std::shared_ptr<MockLockerAndInvoker> mock1, mock2, mock3, mock4, mock5;
// Unique addresses for testing