- 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:
tchernobog 2006-08-28 22:29:56 +00:00
parent 8b7a4ed569
commit 980d9b410a
1 changed files with 7 additions and 3 deletions

View File

@ -446,8 +446,12 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy)
// 3. check for simulation termination (we can directly use threads
// 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++;
}
} //~ for over all_threads