- 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:
parent
ec7c6a7c81
commit
8ca3a61730
|
@ -36,8 +36,6 @@ DynamicProcess::DynamicProcess(const DynamicProcess &other) :
|
||||||
{
|
{
|
||||||
typedef vector<DynamicThread*>::iterator ThreadIt;
|
typedef vector<DynamicThread*>::iterator ThreadIt;
|
||||||
|
|
||||||
_static_process = other._static_process;
|
|
||||||
|
|
||||||
const vector<DynamicThread*>& other_threads = other._dynamic_threads;
|
const vector<DynamicThread*>& other_threads = other._dynamic_threads;
|
||||||
|
|
||||||
// FIXME uncomment when DynamicThread is complete
|
// 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);
|
//it = std::find(_dynamic_threads.begin(), _dynamic_threads.end(), thread);
|
||||||
|
|
||||||
//FIXME Do I need to deallocate the associated memory?
|
|
||||||
//if(it != _dynamic_threads.end())
|
//if(it != _dynamic_threads.end())
|
||||||
|
//{
|
||||||
// _dynamic_threads.erase(it);
|
// _dynamic_threads.erase(it);
|
||||||
|
// delete *it;
|
||||||
|
//}
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
|
|
||||||
namespace sgpem
|
namespace sgpem
|
||||||
{
|
{
|
||||||
class StaticProcess;
|
|
||||||
class DynamicProcess;
|
class DynamicProcess;
|
||||||
|
class StaticProcess;
|
||||||
class DynamicThread;
|
class DynamicThread;
|
||||||
class Thread;
|
class Thread;
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ namespace sgpem
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<DynamicThread*> _dynamic_threads;
|
std::vector<DynamicThread*> _dynamic_threads;
|
||||||
memory::smart_ptr<StaticProcess*> _static_process;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,6 @@ DynamicSchedulable::set_priority_push(int new_value)
|
||||||
int
|
int
|
||||||
DynamicSchedulable::get_current_priority() const
|
DynamicSchedulable::get_current_priority() const
|
||||||
{
|
{
|
||||||
//TODO is this correct?
|
|
||||||
return get_base_priority() + get_priority_push();
|
return get_base_priority() + get_priority_push();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,5 +155,6 @@ DynamicSchedulable::set_state(state s)
|
||||||
StaticSchedulable*
|
StaticSchedulable*
|
||||||
DynamicSchedulable::get_schedulable() const
|
DynamicSchedulable::get_schedulable() const
|
||||||
{
|
{
|
||||||
return _ref;
|
//HACK This is an enormous hack!!!
|
||||||
|
return (StaticSchedulable*)&(*_ref);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "schedulable.hh"
|
#include "schedulable.hh"
|
||||||
#include "static_schedulable.hh"
|
#include "static_schedulable.hh"
|
||||||
|
#include "../templates/smartp.hh"
|
||||||
|
|
||||||
namespace sgpem
|
namespace sgpem
|
||||||
{
|
{
|
||||||
|
@ -122,9 +123,9 @@ namespace sgpem
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int _time_left;
|
int _time_left;
|
||||||
|
memory::smart_ptr<StaticSchedulable> _ref;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StaticSchedulable* _ref;
|
|
||||||
int _last_acquisition;
|
int _last_acquisition;
|
||||||
int _last_release;
|
int _last_release;
|
||||||
int _priority_push;
|
int _priority_push;
|
||||||
|
|
Loading…
Reference in New Issue