Split comment into relevant locations
This commit is contained in:
@@ -260,8 +260,20 @@ public:
|
|||||||
{ serializedContinuation.isAwakeOrBeingAwakened.store(false); }
|
{ serializedContinuation.isAwakeOrBeingAwakened.store(false); }
|
||||||
|
|
||||||
/** EXPLANATION:
|
/** EXPLANATION:
|
||||||
* Creates a shared_ptr copy of this lockvoker and registers it with
|
* We create a copy of the Lockvoker and then give sh_ptrs to that
|
||||||
* the serialized continuation's LockSet.
|
* *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()
|
void registerInLockSet()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,21 +17,6 @@ void LockSet<OriginalCbFnT>::registerInQutexQueues(
|
|||||||
* iterator so that we can quickly move the lockvoker around within
|
* iterator so that we can quickly move the lockvoker around within
|
||||||
* the queue, and eventually, erase() it when we acquire all the
|
* the queue, and eventually, erase() it when we acquire all the
|
||||||
* locks.
|
* 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)
|
for (auto& lockUsageDesc : locks)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user