- Added DynamicThread class
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@649 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
0a2f37345f
commit
e95d915e3a
5 changed files with 234 additions and 23 deletions
|
@ -19,7 +19,9 @@
|
|||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "static_thread.hh"
|
||||
|
||||
using namespace sgpem;
|
||||
using std::vector;
|
||||
|
||||
StaticThread::StaticThread(const Glib::ustring& name,
|
||||
StaticProcess& process,
|
||||
|
@ -31,24 +33,46 @@ StaticThread::StaticThread(const Glib::ustring& name,
|
|||
{
|
||||
}
|
||||
|
||||
// FIXME unmcomment when StaticSchedulable complies to the design
|
||||
// unsigned int StaticThread::get_total_cpu_time() const
|
||||
// {
|
||||
// return _required_cpu_time;
|
||||
// }
|
||||
//
|
||||
// unsigned int StaticThread::get_arrival_time() const
|
||||
// {
|
||||
// return _start_time_delta;
|
||||
// }
|
||||
//
|
||||
// void StaticThread::set_arrival_time(unsigned int time)
|
||||
// {
|
||||
// _start_time_delta = time;
|
||||
// }
|
||||
unsigned int
|
||||
StaticThread::get_total_cpu_time() const
|
||||
{
|
||||
return _required_cpu_time;
|
||||
}
|
||||
|
||||
StaticProcess& StaticThread::get_process()
|
||||
unsigned int
|
||||
StaticThread::get_arrival_time() const
|
||||
{
|
||||
return _start_time_delta;
|
||||
}
|
||||
|
||||
StaticProcess&
|
||||
StaticThread::get_process()
|
||||
{
|
||||
return *_process;
|
||||
}
|
||||
|
||||
void
|
||||
StaticThread::remove_request(StaticRequest* request)
|
||||
{
|
||||
assert(request != NULL);
|
||||
|
||||
vector<StaticRequest*>::iterator it;
|
||||
|
||||
// FIXME uncomment once requests are compelted
|
||||
//it = std::find(_static_requests.begin(), _static_requests.end(), request);
|
||||
|
||||
//if(it != _static_requests.end())
|
||||
//{
|
||||
// _static_requests.erase(it);
|
||||
// delete *it;
|
||||
//}
|
||||
}
|
||||
|
||||
void
|
||||
StaticThread::add_request(StaticRequest* request)
|
||||
{
|
||||
assert(request != NULL);
|
||||
|
||||
_static_requests.push_back(request);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue