Rename: LockSpec=>LockSet

This commit is contained in:
2025-09-18 22:21:06 -04:00
parent eb3366cfd2
commit ec50526804
3 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -106,7 +106,7 @@ public:
template <class OriginalCbFnT> template <class OriginalCbFnT>
class SerializedAsynchronousContinuation class SerializedAsynchronousContinuation
: public PostedAsynchronousContinuation<OriginalCbFnT>, public LockSpec : public PostedAsynchronousContinuation<OriginalCbFnT>, public LockSet
{ {
public: public:
SerializedAsynchronousContinuation( SerializedAsynchronousContinuation(
@@ -114,13 +114,13 @@ public:
OriginalCbFnT originalCbFn, OriginalCbFnT originalCbFn,
std::vector<std::reference_wrapper<SpinLock>> requiredLocks = {}) std::vector<std::reference_wrapper<SpinLock>> requiredLocks = {})
: PostedAsynchronousContinuation<OriginalCbFnT>(caller, originalCbFn), : PostedAsynchronousContinuation<OriginalCbFnT>(caller, originalCbFn),
LockSpec(std::move(requiredLocks)) LockSet(std::move(requiredLocks))
{} {}
template<typename... Args> template<typename... Args>
void callOriginalCb(Args&&... args) void callOriginalCb(Args&&... args)
{ {
LockSpec::release(); LockSet::release();
PostedAsynchronousContinuation<OriginalCbFnT>::callOriginalCb( PostedAsynchronousContinuation<OriginalCbFnT>::callOriginalCb(
std::forward<Args>(args)...); std::forward<Args>(args)...);
} }
+5 -5
View File
@@ -10,16 +10,16 @@
namespace smo { namespace smo {
/** /**
* @brief LockSpec - Manages a collection of locks for acquisition/release * @brief LockSet - Manages a collection of locks for acquisition/release
*/ */
class LockSpec class LockSet
{ {
public: public:
/** /**
* @brief Constructor * @brief Constructor
* @param requiredLocks Vector of lock references that must be acquired * @param requiredLocks Vector of lock references that must be acquired
*/ */
LockSpec(std::vector<std::reference_wrapper<SpinLock>> requiredLocks = {}) LockSet(std::vector<std::reference_wrapper<SpinLock>> requiredLocks = {})
: requiredLocks(std::move(requiredLocks)), allLocksAcquired(false) : requiredLocks(std::move(requiredLocks)), allLocksAcquired(false)
{} {}
@@ -33,7 +33,7 @@ public:
{ {
throw std::runtime_error( throw std::runtime_error(
std::string(__func__) + std::string(__func__) +
": LockSpec::tryAcquire() called but allLocksAcquired is " ": LockSet::tryAcquire() called but allLocksAcquired is "
"already true"); "already true");
} }
@@ -68,7 +68,7 @@ public:
{ {
throw std::runtime_error( throw std::runtime_error(
std::string(__func__) + std::string(__func__) +
": LockSpec::release() called but allLocksAcquired is false"); ": LockSet::release() called but allLocksAcquired is false");
} }
for (auto& lockRef : requiredLocks) { for (auto& lockRef : requiredLocks) {
+1 -1
View File
@@ -23,7 +23,7 @@ public:
/** /**
* @brief Constructor that immediately posts to io_service * @brief Constructor that immediately posts to io_service
* @param serializedContinuation Reference to the serialized continuation * @param serializedContinuation Reference to the serialized continuation
* containing LockSpec and target io_service * containing LockSet and target io_service
* @param invocationTarget The std::bind result to invoke when locks are acquired * @param invocationTarget The std::bind result to invoke when locks are acquired
*/ */
LockerAndInvoker( LockerAndInvoker(