- Merge branch 0.3-r1003--scheduler-manage-preemption into trunk

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1023 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-09-06 12:29:22 +00:00
parent cb5d958790
commit df4b1b4205
11 changed files with 158 additions and 55 deletions

View file

@ -27,7 +27,7 @@ using sgpem::ReadyQueue;
void
ReadyQueue::swap(position a, position b)
throw (std::out_of_range)
throw (std::out_of_range)
{
if (a == b) return;
@ -51,7 +51,7 @@ ReadyQueue::size() const
sgpem::Thread&
ReadyQueue::get_item_at(position index)
throw (std::out_of_range)
throw (std::out_of_range)
{
// Checks index access
return *_scheds.at(index);
@ -59,7 +59,7 @@ throw (std::out_of_range)
const sgpem::Thread&
ReadyQueue::get_item_at(position index) const
throw (std::out_of_range)
throw (std::out_of_range)
{
// Checks index access
return *_scheds.at(index);
@ -71,6 +71,18 @@ ReadyQueue::append(Thread& thread)
_scheds.push_back(&thread);
}
void
ReadyQueue::bubble_to_front(position x)
throw(std::out_of_range)
{
while(x > 0)
{
swap(x - 1, x);
--x;
}
}
void
ReadyQueue::erase_first()
{