- Fix deadlock that blocked PythonPolicy::sort_queue

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@796 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-07-28 12:21:49 +00:00
parent ebeda15359
commit 6c79bc361c
5 changed files with 15 additions and 20 deletions

View file

@ -131,14 +131,14 @@ update_requests_for_old_running_thread(DynamicThread& running_thread)
//private constructor. The parameter is discarded
Scheduler::Scheduler()
: _ready_queue(NULL), _policy(NULL)
{}
: _ready_queue(NULL), _policy(NULL), _step_mutex()
{
}
ReadyQueue*
Scheduler::get_ready_queue()
{
// FIXME return the correct queue accordingly to the value returned by Policy::wants()
return _ready_queue;
}
@ -168,7 +168,7 @@ Scheduler::step_forward(History& history, Policy& cpu_policy) throw(UserInterrup
// store a readyqueue and policy pointer for the user-policy to retrieve, to when
// the policy returns
// TODO: restrict this area to maximise parallelism
Glib::Mutex::Lock lock(_mutex);
Glib::Mutex::Lock lock(_step_mutex);
// NOTE: Be sure to read the *ORIGINAL* documentation in the design document for this method!