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

@ -159,7 +159,7 @@ class EpollLoop : SelectorLoop
}
else if (io.output.length)
{
swapPendings.insertBack(io);
swapPendings.enqueue(io);
}
}
else if (events[i].events & EPOLLOUT)

View File

@ -218,11 +218,11 @@ class IOCPLoop : Loop
auto transport = MmapPool.instance.make!IOCPStreamTransport(socket);
auto io = MmapPool.instance.make!IOWatcher(transport, connection.protocol);
connection.incoming.insertBack(io);
connection.incoming.enqueue(io);
reify(io, EventMask(Event.none), EventMask(Event.read, Event.write));
swapPendings.insertBack(connection);
swapPendings.enqueue(connection);
listener.beginAccept(overlapped);
break;
case OverlappedSocketEvent.read:
@ -264,7 +264,7 @@ class IOCPLoop : Loop
{
transport.socket.beginReceive(io.output[], overlapped);
}
swapPendings.insertBack(io);
swapPendings.enqueue(io);
}
break;
case OverlappedSocketEvent.write:

View File

@ -271,7 +271,7 @@ class KqueueLoop : SelectorLoop
}
else if (io.output.length)
{
swapPendings.insertBack(io);
swapPendings.enqueue(io);
}
}
else if (events[i].filter == EVFILT_WRITE)

View File

@ -248,12 +248,12 @@ abstract class SelectorLoop : Loop
}
reify(io, EventMask(Event.none), EventMask(Event.read, Event.write));
connection.incoming.insertBack(io);
connection.incoming.enqueue(io);
}
if (!connection.incoming.empty)
{
swapPendings.insertBack(connection);
swapPendings.enqueue(connection);
}
}
}