21 #include "pedigree/kernel/process/RoundRobin.h" 22 #include "pedigree/kernel/LockGuard.h" 23 #include "pedigree/kernel/process/Thread.h" 24 #include "pedigree/kernel/processor/types.h" 25 #include "pedigree/kernel/utilities/Iterator.h" 26 #include "pedigree/kernel/utilities/assert.h" 27 #include "pedigree/kernel/utilities/utility.h" 45 for (
size_t i = 0; i < MAX_PRIORITIES; i++)
48 it != m_pReadyQueues[i].
end(); it++)
52 m_pReadyQueues[i].
erase(it);
64 for (
size_t i = 0; i < MAX_PRIORITIES; i++)
66 if (m_pReadyQueues[i].size())
68 pThread = m_pReadyQueues[i].
popFront();
69 if (pThread == pCurrentThread)
83 if (RoundRobin::isReady(pThread))
85 assert(pThread->getPriority() < MAX_PRIORITIES);
88 m_pReadyQueues[pThread->getPriority()].
begin();
89 it != m_pReadyQueues[pThread->getPriority()].
end(); ++it)
99 m_pReadyQueues[pThread->getPriority()].
pushBack(pThread);
103 bool RoundRobin::isReady(
Thread *pThread)
105 return pThread->
getStatus() == Thread::Ready;
void pushBack(const T &value)
Iterator erase(Iterator &Iter)
virtual Thread * getNext(Thread *pCurrentThread)
::Iterator< Thread *, node_t > Iterator
virtual void removeThread(Thread *pThread)
virtual void addThread(Thread *pThread)
virtual void threadStatusChanged(Thread *pThread)