- Fix a minor bug in scheduler that didn't ended the simulation
if there was a 'hole' between threads of the same process. The fix isn't the most elegant thing in the universe, but it's simple and it'll do. git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@957 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
8b7a4ed569
commit
980d9b410a
|
@ -446,8 +446,12 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy)
|
||||||
|
|
||||||
// 3. check for simulation termination (we can directly use threads
|
// 3. check for simulation termination (we can directly use threads
|
||||||
// for this check, since processes' state is based upon threads' one)
|
// for this check, since processes' state is based upon threads' one)
|
||||||
if ((current.get_state() & (Schedulable::state_blocked | Schedulable::state_terminated)) == 0)
|
Schedulable::state cur_state = current.get_state();
|
||||||
|
if ((cur_state & (Schedulable::state_blocked | Schedulable::state_terminated)) == 0 &&
|
||||||
|
(current.get_process().get_state() != Schedulable::state_terminated)) // check for holes
|
||||||
|
{
|
||||||
alive_threads++;
|
alive_threads++;
|
||||||
|
}
|
||||||
|
|
||||||
} //~ for over all_threads
|
} //~ for over all_threads
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue