Port: Only indicate that a SimpleTimingPort is drained if its send event is

not scheduled, as well as the transmit list being empty.
This commit is contained in:
Timothy M. Jones
2010-07-22 18:54:37 +01:00
parent e50a880297
commit 28a5ea3f99
2 changed files with 3 additions and 3 deletions

View File

@@ -1569,7 +1569,7 @@ Cache<TagStore>::MemSidePort::sendPacket()
schedule(sendEvent, std::max(nextReady, curTick + 1));
} else {
// no more to send right now: if we're draining, we may be done
if (drainEvent) {
if (drainEvent && !sendEvent->scheduled()) {
drainEvent->process();
drainEvent = NULL;
}

View File

@@ -155,7 +155,7 @@ SimpleTimingPort::sendDeferredPacket()
schedule(sendEvent, time <= curTick ? curTick+1 : time);
}
if (transmitList.empty() && drainEvent) {
if (transmitList.empty() && drainEvent && !sendEvent->scheduled()) {
drainEvent->process();
drainEvent = NULL;
}
@@ -195,7 +195,7 @@ SimpleTimingPort::processSendEvent()
unsigned int
SimpleTimingPort::drain(Event *de)
{
if (transmitList.size() == 0)
if (transmitList.size() == 0 && !sendEvent->scheduled())
return 0;
drainEvent = de;
return 1;