- Minor changes to DynamicProcess and DynamicSchedulable to reflect change in design

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@642 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-06-20 21:49:13 +00:00
parent ec7c6a7c81
commit 8ca3a61730
4 changed files with 10 additions and 9 deletions

View File

@ -36,8 +36,6 @@ DynamicProcess::DynamicProcess(const DynamicProcess &other) :
{
typedef vector<DynamicThread*>::iterator ThreadIt;
_static_process = other._static_process;
const vector<DynamicThread*>& other_threads = other._dynamic_threads;
// FIXME uncomment when DynamicThread is complete
@ -71,9 +69,12 @@ DynamicProcess::remove_thread(Thread* thread)
//it = std::find(_dynamic_threads.begin(), _dynamic_threads.end(), thread);
//FIXME Do I need to deallocate the associated memory?
//if(it != _dynamic_threads.end())
//{
// _dynamic_threads.erase(it);
// delete *it;
//}
//
}
void

View File

@ -32,8 +32,8 @@
namespace sgpem
{
class StaticProcess;
class DynamicProcess;
class StaticProcess;
class DynamicThread;
class Thread;
@ -54,7 +54,6 @@ namespace sgpem
private:
std::vector<DynamicThread*> _dynamic_threads;
memory::smart_ptr<StaticProcess*> _static_process;
};
}

View File

@ -75,7 +75,6 @@ DynamicSchedulable::set_priority_push(int new_value)
int
DynamicSchedulable::get_current_priority() const
{
//TODO is this correct?
return get_base_priority() + get_priority_push();
}
@ -156,5 +155,6 @@ DynamicSchedulable::set_state(state s)
StaticSchedulable*
DynamicSchedulable::get_schedulable() const
{
return _ref;
//HACK This is an enormous hack!!!
return (StaticSchedulable*)&(*_ref);
}

View File

@ -24,6 +24,7 @@
#include "config.h"
#include "schedulable.hh"
#include "static_schedulable.hh"
#include "../templates/smartp.hh"
namespace sgpem
{
@ -122,9 +123,9 @@ namespace sgpem
protected:
int _time_left;
memory::smart_ptr<StaticSchedulable> _ref;
private:
StaticSchedulable* _ref;
int _last_acquisition;
int _last_release;
int _priority_push;