org.jikesrvm.scheduler.greenthreads
Class ThreadProxyWaitingQueue

java.lang.Object
  extended by org.jikesrvm.scheduler.greenthreads.AbstractThreadQueue
      extended by org.jikesrvm.scheduler.greenthreads.ThreadProxyWaitingQueue

public final class ThreadProxyWaitingQueue
extends AbstractThreadQueue

See Proxy


Field Summary
private  ThreadProxy head
          The head of the list of waiting proxies
private  ThreadProxy tail
          The end of the list of waiting proxies
 
Constructor Summary
ThreadProxyWaitingQueue()
           
 
Method Summary
(package private)  boolean contains(RVMThread t)
           
 GreenThread dequeue()
          Remove thread from head of queue.
(package private)  void dump()
           
 void enqueue(GreenThread t)
          Put proxy for this thread on the queue.
 void enqueue(ThreadProxy p)
          Add the proxy for a thread to tail of queue.
 boolean isEmpty()
          Are any proxies on the queue?
 int length()
          Number of items on queue (an estimate: queue is not locked during the scan).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tail

private ThreadProxy tail
The end of the list of waiting proxies


head

private ThreadProxy head
The head of the list of waiting proxies

Constructor Detail

ThreadProxyWaitingQueue

public ThreadProxyWaitingQueue()
Method Detail

isEmpty

public boolean isEmpty()
Are any proxies on the queue?

Specified by:
isEmpty in class AbstractThreadQueue

enqueue

public void enqueue(GreenThread t)
Put proxy for this thread on the queue. Since a processor lock is held, the proxy cannot be created here. Instead, it is cached in the proxy field of the thread.

Specified by:
enqueue in class AbstractThreadQueue

enqueue

public void enqueue(ThreadProxy p)
Add the proxy for a thread to tail of queue.


dequeue

public GreenThread dequeue()
Remove thread from head of queue.

Specified by:
dequeue in class AbstractThreadQueue
Returns:
the thread (null --> queue is empty)

length

public int length()
Number of items on queue (an estimate: queue is not locked during the scan).

Specified by:
length in class AbstractThreadQueue

contains

boolean contains(RVMThread t)

dump

void dump()