diff --git a/src/backend/dynamic_process.cc b/src/backend/dynamic_process.cc index c73e89a..628cd4e 100644 --- a/src/backend/dynamic_process.cc +++ b/src/backend/dynamic_process.cc @@ -36,8 +36,6 @@ DynamicProcess::DynamicProcess(const DynamicProcess &other) : { typedef vector::iterator ThreadIt; - _static_process = other._static_process; - const vector& 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); + //{ + // _dynamic_threads.erase(it); + // delete *it; + //} + // } void diff --git a/src/backend/dynamic_process.hh b/src/backend/dynamic_process.hh index 648ae85..3fa116e 100644 --- a/src/backend/dynamic_process.hh +++ b/src/backend/dynamic_process.hh @@ -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 _dynamic_threads; - memory::smart_ptr _static_process; }; } diff --git a/src/backend/dynamic_schedulable.cc b/src/backend/dynamic_schedulable.cc index 35eaecf..a49449d 100644 --- a/src/backend/dynamic_schedulable.cc +++ b/src/backend/dynamic_schedulable.cc @@ -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); } diff --git a/src/backend/dynamic_schedulable.hh b/src/backend/dynamic_schedulable.hh index 961c8fe..8279109 100644 --- a/src/backend/dynamic_schedulable.hh +++ b/src/backend/dynamic_schedulable.hh @@ -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 _ref; private: - StaticSchedulable* _ref; int _last_acquisition; int _last_release; int _priority_push;