- This was an *evil* "chicken-or-egg-first" bug in CPUPoliciesGatekeeper. Now

CPUPolicy->activate() should run properly.


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@846 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-08-12 17:04:21 +00:00
parent 59edb09c14
commit 9ff7502bb4
3 changed files with 16 additions and 31 deletions

View file

@ -22,7 +22,7 @@
#include "concrete_history.hh"
#include "cpu_policy.hh"
#include "scheduler.hh"
#include "user_interrupt_exception.hh"
#include "cpu_policy_exception.hh"
// Do not include full template definition in the header file
#include "singleton.tcc"
@ -71,14 +71,6 @@ Scheduler::get_policy()
//.............................................................................
static bool
validate_environment(ConcreteEnvironment& e)
{
return true;
}
// Introduces newly arrived processes.
// Postcondition:
// for each process p in next_snapshot
@ -542,21 +534,6 @@ check_if_simulation_is_terminated(unsigned int front, auto_ptr<ConcreteEnvironme
}
static void
print_queue(unsigned int front, auto_ptr<ConcreteEnvironment>& next_snapshot)
{
ReadyQueue& queue = next_snapshot->get_sorted_queue();
for(unsigned int i = 0; i < queue.size(); i++)
{
std::cout << queue.get_item_at(i).get_name();
}
}
static bool
try_to_run(unsigned int front, auto_ptr<ConcreteEnvironment>& next_snapshot)
{
@ -731,7 +708,7 @@ Scheduler::step_forward(ConcreteHistory& concrete_history, CPUPolicy& cpu_policy
return !terminated; // watch out for the !
}
catch(UserInterruptException& e)
catch(CPUPolicyException& e)
{
// Reset values that the policy doesn't need anymore
_policy = NULL;