Lockvoker: Add registerInLockSet
We now create the sh_ptr to the copy of a lockvoker object in its own supplied register method. This enables us to retain type safety when calling make_shared, by copying the most derived version of the lockvoker object. Then we can pass in the LockerAndInvokerBase to the rest of the call chain.
This commit is contained in:
+2
-6
@@ -7,9 +7,8 @@ namespace smo {
|
||||
// These will be explicitly instantiated for the types we need
|
||||
|
||||
template <class OriginalCbFnT>
|
||||
template <class InvocationTargetT>
|
||||
void LockSet<OriginalCbFnT>::registerInQutexQueues(
|
||||
const typename SerializedAsynchronousContinuation<OriginalCbFnT>::template LockerAndInvoker<InvocationTargetT> &lockvoker
|
||||
const std::shared_ptr<LockerAndInvokerBase> &lockvoker
|
||||
)
|
||||
{
|
||||
/** EXPLANATION:
|
||||
@@ -34,13 +33,10 @@ void LockSet<OriginalCbFnT>::registerInQutexQueues(
|
||||
* io_service, potentially without being executed if they fail to
|
||||
* acquire all locks.
|
||||
*/
|
||||
auto sharedLockvoker = std::make_shared<
|
||||
typename SerializedAsynchronousContinuation<OriginalCbFnT>::template LockerAndInvoker<InvocationTargetT>>(lockvoker);
|
||||
|
||||
for (auto& lockUsageDesc : locks)
|
||||
{
|
||||
lockUsageDesc.second = lockUsageDesc.first.get().registerInQueue(
|
||||
sharedLockvoker);
|
||||
lockvoker);
|
||||
}
|
||||
|
||||
registeredInQutexQueues = true;
|
||||
|
||||
Reference in New Issue
Block a user