Replace curTick global variable with accessor functions.
This step makes it easy to replace the accessor functions (which still access a global variable) with ones that access per-thread curTick values.
This commit is contained in:
@@ -154,7 +154,7 @@ EtherLink::Link::txDone()
|
||||
if (linkDelay > 0) {
|
||||
DPRINTF(Ethernet, "packet delayed: delay=%d\n", linkDelay);
|
||||
Event *event = new LinkDelayEvent(this, packet);
|
||||
parent->schedule(event, curTick + linkDelay);
|
||||
parent->schedule(event, curTick() + linkDelay);
|
||||
} else {
|
||||
txComplete(packet);
|
||||
}
|
||||
@@ -183,7 +183,7 @@ EtherLink::Link::transmit(EthPacketPtr pkt)
|
||||
|
||||
DPRINTF(Ethernet, "scheduling packet: delay=%d, (rate=%f)\n",
|
||||
delay, ticksPerByte);
|
||||
parent->schedule(doneEvent, curTick + delay);
|
||||
parent->schedule(doneEvent, curTick() + delay);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user