diff options
Diffstat (limited to 'src/cpu/o3/cpu.hh')
-rw-r--r-- | src/cpu/o3/cpu.hh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 7095e52ec..dd9f5d40f 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -184,9 +184,19 @@ class FullO3CPU : public BaseO3CPU if (activateThreadEvent[tid].squashed()) reschedule(activateThreadEvent[tid], nextCycle(curTick() + ticks(delay))); - else if (!activateThreadEvent[tid].scheduled()) - schedule(activateThreadEvent[tid], - nextCycle(curTick() + ticks(delay))); + else if (!activateThreadEvent[tid].scheduled()) { + Tick when = nextCycle(curTick() + ticks(delay)); + + // Check if the deallocateEvent is also scheduled, and make + // sure they do not happen at same time causing a sleep that + // is never woken from. + if (deallocateContextEvent[tid].scheduled() && + deallocateContextEvent[tid].when() == when) { + when++; + } + + schedule(activateThreadEvent[tid], when); + } } /** Unschedule actiavte thread event, regardless of its current state. */ |