diff --git a/include/serializedAsynchronousContinuation.h b/include/serializedAsynchronousContinuation.h index 813ed1f..3a30a77 100644 --- a/include/serializedAsynchronousContinuation.h +++ b/include/serializedAsynchronousContinuation.h @@ -260,8 +260,20 @@ public: { serializedContinuation.isAwakeOrBeingAwakened.store(false); } /** EXPLANATION: - * Creates a shared_ptr copy of this lockvoker and registers it with - * the serialized continuation's LockSet. + * We create a copy of the Lockvoker and then give sh_ptrs to that + * *COPY*, to each Qutex's internal queue. This enables us to keep + * the AsyncContinuation sh_ptr (which the Lockvoker contains within + * itself) alive without wasting too much memory. + * + * This way the io_service objects can remove the lockvoker from + * their queues and there'll be a copy of the lockvoker in each + * Qutex's queue. + * + * For non-serialized, posted continuations, they won't be removed + * from the io_service queue until they're executed, so there's no + * need to create copies of them. Lockvokers are removed from their + * io_service, potentially without being executed if they fail to + * acquire all locks. */ void registerInLockSet() { diff --git a/smocore/lockSet.cpp b/smocore/lockSet.cpp index 0aeff51..cb7ef15 100644 --- a/smocore/lockSet.cpp +++ b/smocore/lockSet.cpp @@ -17,21 +17,6 @@ void LockSet::registerInQutexQueues( * iterator so that we can quickly move the lockvoker around within * the queue, and eventually, erase() it when we acquire all the * locks. - * - * We create a copy of the Lockvoker and then give sh_ptrs to that - * *COPY*, to each Qutex's internal queue. This enables us to keep - * the AsyncContinuation sh_ptr (which the Lockvoker contains within - * itself) alive without wasting too much memory. - * - * This way the io_service objects can remove the lockvoker from - * their queues and there'll be a copy of the lockvoker in each - * Qutex's queue. - * - * For non-serialized, posted continuations, they won't be removed - * from the io_service queue until they're executed, so there's no - * need to create copies of them. Lockvokers are removed from their - * io_service, potentially without being executed if they fail to - * acquire all locks. */ for (auto& lockUsageDesc : locks) {