public class ThreadQueue extends Object
Modifier and Type | Field and Description |
---|---|
(package private) RVMThread |
head |
(package private) RVMThread |
tail |
protected static boolean |
trace |
Constructor and Description |
---|
ThreadQueue() |
Modifier and Type | Method and Description |
---|---|
RVMThread |
dequeue() |
void |
dump() |
void |
enqueue(RVMThread t) |
private RVMThread |
getNext(RVMThread cur) |
boolean |
isEmpty() |
boolean |
isQueued(RVMThread t) |
RVMThread |
peek() |
boolean |
remove(RVMThread t)
Removes the given thread from the queue if the thread is still on the queue.
|
private void |
setNext(RVMThread cur,
RVMThread value)
Sets the next pointer of cur to value unless cur is
null ,
in which case it sets head. |
protected static final boolean trace
public ThreadQueue()
public boolean isEmpty()
private RVMThread getNext(RVMThread cur)
cur
- a threadnull
, in which
case it returns head.private void setNext(RVMThread cur, RVMThread value)
null
,
in which case it sets head. Also sets tail as appropriate.cur
- a threadvalue
- a value for the next pointer of the given threadpublic boolean remove(RVMThread t)
t
- thread to remove from the queuepublic void dump()