CPU: If the simple CPU is already idle, just return from suspendContext, don't assert.

This commit is contained in:
Gabe Black 2009-04-19 02:23:29 -07:00
parent 05b5861419
commit d10195b1a4
2 changed files with 6 additions and 0 deletions

View file

@ -271,6 +271,9 @@ AtomicSimpleCPU::suspendContext(int thread_num)
assert(thread_num == 0);
assert(thread);
if (_status == Idle)
return;
assert(_status == Running);
// tick event may not be scheduled if this gets called from inside

View file

@ -233,6 +233,9 @@ TimingSimpleCPU::suspendContext(int thread_num)
assert(thread_num == 0);
assert(thread);
if (_status == Idle)
return;
assert(_status == Running);
// just change status to Idle... if status != Running,