org.jikesrvm.scheduler
Class ThreadQueue
java.lang.Object
org.jikesrvm.scheduler.ThreadQueue
public class ThreadQueue
- extends Object
An unsynchronized queue data structure for Threads. The current uses are all
where there is some other lock that already protects the queue.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
trace
protected static final boolean trace
- See Also:
- Constant Field Values
head
RVMThread head
tail
RVMThread tail
ThreadQueue
public ThreadQueue()
isEmpty
public boolean isEmpty()
enqueue
public void enqueue(RVMThread t)
peek
public RVMThread peek()
dequeue
public RVMThread dequeue()
getNext
private RVMThread getNext(RVMThread cur)
- Private helper. Gets the next pointer of cur unless cur is
null
, in which
case it returns head.
setNext
private void setNext(RVMThread cur,
RVMThread value)
- Private helper. Sets the next pointer of cur to value unless cur is
null
,
in which case it sets head. Also sets tail as appropriate.
remove
public boolean remove(RVMThread t)
- Remove the given thread from the queue if the thread is still on the queue.
Does nothing (and returns in O(1)) if the thread is not on the queue. Also
does nothing (and returns in O(1)) if the thread is on a different queue.
isQueued
public boolean isQueued(RVMThread t)
dump
public void dump()