o3: handle fetch with no active threads correctly.

This situation can arise now on the first fetch cycle after
the last active thread is halted.  It seems easy enough to
deal with when it happens rather than trying to avoid it.
This commit is contained in:
Steve Reinhardt
2009-04-15 23:12:00 -07:00
parent bb974d5a47
commit b146131d18

View File

@@ -1326,7 +1326,10 @@ DefaultFetch<Impl>::getFetchingThread(FetchPriority &fetch_priority)
}
} else {
std::list<unsigned>::iterator thread = activeThreads->begin();
assert(thread != activeThreads->end());
if (thread == activeThreads->end()) {
return -1;
}
int tid = *thread;
if (fetchStatus[tid] == Running ||