Queue: Leave only enqueue/dequeue/empty/opApply

This commit is contained in:
2017-01-11 18:24:50 +01:00
parent 291920b479
commit ab930657b6
7 changed files with 70 additions and 107 deletions

View File

@ -184,8 +184,10 @@ abstract class Loop
poll();
// Invoke pendings
swapPendings.each!((ref p) @nogc => p.invoke());
foreach (ref w; *swapPendings)
{
w.invoke();
}
swap(pendings, swapPendings);
}
while (!done_);
@ -283,7 +285,7 @@ abstract class Loop
defaultAllocator.dispose(watcher.socket);
MmapPool.instance.dispose(watcher.transport);
watcher.exception = exception;
swapPendings.insertBack(watcher);
swapPendings.enqueue(watcher);
}
/**