- Added requests system
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@652 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
d8cd3577a7
commit
56db7cd6a2
23 changed files with 980 additions and 40 deletions
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "dynamic_process.hh"
|
||||
#include "static_process.hh"
|
||||
|
||||
#include "dynamic_thread.hh"
|
||||
#include <cassert>
|
||||
|
||||
using namespace sgpem;
|
||||
|
@ -34,21 +34,18 @@ DynamicProcess::DynamicProcess(StaticProcess* core) :
|
|||
DynamicProcess::DynamicProcess(const DynamicProcess &other) :
|
||||
Schedulable(), DynamicSchedulable(other), Process()
|
||||
{
|
||||
typedef vector<DynamicThread*>::iterator ThreadIt;
|
||||
typedef vector<DynamicThread*>::const_iterator ThreadIt;
|
||||
|
||||
const vector<DynamicThread*>& other_threads = other._dynamic_threads;
|
||||
|
||||
// FIXME uncomment when DynamicThread is complete
|
||||
// for(ThreadIt it = other_threads.begin(); it != other_threads.end(); ++it)
|
||||
// _dynamic_threads.push_back(new DynamicThread(*(*it)));
|
||||
for(ThreadIt it = other_threads.begin(); it != other_threads.end(); ++it)
|
||||
_dynamic_threads.push_back(new DynamicThread(*(*it)));
|
||||
}
|
||||
|
||||
std::vector<Thread*>
|
||||
DynamicProcess::get_threads()
|
||||
{
|
||||
//FIXME uncomment when DynamicThread is complete
|
||||
//return vector<Thread*>(_dynamic_threads.begin(), _dynamic_threads.end());
|
||||
return vector<Thread*>();
|
||||
return vector<Thread*>(_dynamic_threads.begin(), _dynamic_threads.end());
|
||||
}
|
||||
|
||||
Schedulable::state
|
||||
|
@ -64,17 +61,16 @@ DynamicProcess::remove_thread(Thread* thread)
|
|||
{
|
||||
assert(thread != NULL);
|
||||
|
||||
//FIXME uncomment me once DynamicThread is complete
|
||||
//vector<DynamicThread*>::iterator it;
|
||||
vector<DynamicThread*>::iterator it;
|
||||
|
||||
//it = std::find(_dynamic_threads.begin(), _dynamic_threads.end(), thread);
|
||||
it = std::find(_dynamic_threads.begin(), _dynamic_threads.end(), thread);
|
||||
|
||||
//if(it != _dynamic_threads.end())
|
||||
//{
|
||||
// _dynamic_threads.erase(it);
|
||||
// delete *it;
|
||||
//}
|
||||
//
|
||||
if(it != _dynamic_threads.end())
|
||||
{
|
||||
_dynamic_threads.erase(it);
|
||||
delete *it;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue