|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nachos.threads.PriorityScheduler.ThreadState
protected class PriorityScheduler.ThreadState
The scheduling state of a thread. This should include the thread's priority, its effective priority, any objects it owns, and the queue it's waiting for, if any.
KThread.schedulingState
Field Summary | |
---|---|
protected int |
priority
The priority of the associated thread. |
protected KThread |
thread
The thread with which this object is associated. |
Constructor Summary | |
---|---|
PriorityScheduler.ThreadState(KThread thread)
Allocate a new ThreadState object and associate it with the specified thread. |
Method Summary | |
---|---|
void |
acquire(PriorityScheduler.PriorityQueue waitQueue)
Called when the associated thread has acquired access to whatever is guarded by waitQueue. |
int |
getEffectivePriority()
Return the effective priority of the associated thread. |
int |
getPriority()
Return the priority of the associated thread. |
void |
setPriority(int priority)
Set the priority of the associated thread to the specified value. |
void |
waitForAccess(PriorityScheduler.PriorityQueue waitQueue)
Called when waitForAccess(thread) (where thread is the associated thread) is invoked on the specified priority queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected KThread thread
protected int priority
Constructor Detail |
---|
public PriorityScheduler.ThreadState(KThread thread)
thread
- the thread this state belongs to.Method Detail |
---|
public int getPriority()
public int getEffectivePriority()
public void setPriority(int priority)
priority
- the new priority.public void waitForAccess(PriorityScheduler.PriorityQueue waitQueue)
waitQueue
- the queue that the associated thread is
now waiting on.ThreadQueue.waitForAccess(nachos.threads.KThread)
public void acquire(PriorityScheduler.PriorityQueue waitQueue)
ThreadQueue.acquire(nachos.threads.KThread)
,
ThreadQueue.nextThread()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |