org.jikesrvm.scheduler
Class RVMThread.GCBlockAdapter

java.lang.Object
  extended by org.jikesrvm.scheduler.RVMThread.BlockAdapter
      extended by org.jikesrvm.scheduler.RVMThread.GCBlockAdapter
Enclosing class:
RVMThread

public static class RVMThread.GCBlockAdapter
extends RVMThread.BlockAdapter


Constructor Summary
RVMThread.GCBlockAdapter()
           
 
Method Summary
(package private)  void clearBlockRequest(RVMThread t)
          Clear any blocking requests.
(package private)  boolean hasBlockRequest(RVMThread t)
          Does the thread have a request to block for this block adapter?
(package private)  boolean hasBlockRequest(RVMThread t, int token)
          Does the thread have a request to block associated with the given requestBlock() call?
(package private)  boolean isBlocked(RVMThread t)
          Should the given thread be blocked for this block adapter?
(package private)  int requestBlock(RVMThread t)
          Request that the thread block, for this block adapter, at its earliest convenience.
(package private)  void setBlocked(RVMThread t, boolean value)
          Specify that the thread is either blocked (value == true) or not blocked (value == false) for this block adapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RVMThread.GCBlockAdapter

public RVMThread.GCBlockAdapter()
Method Detail

isBlocked

boolean isBlocked(RVMThread t)
Description copied from class: RVMThread.BlockAdapter
Should the given thread be blocked for this block adapter? If this returns true, the thread is guaranteed to block.

Specified by:
isBlocked in class RVMThread.BlockAdapter

setBlocked

void setBlocked(RVMThread t,
                boolean value)
Description copied from class: RVMThread.BlockAdapter
Specify that the thread is either blocked (value == true) or not blocked (value == false) for this block adapter. This call indicates a statement of fact by the thread itself - it's used either to acknowledge a block request (see hasBlockRequest below) or to respond to a request to unblock.

Specified by:
setBlocked in class RVMThread.BlockAdapter

requestBlock

int requestBlock(RVMThread t)
Description copied from class: RVMThread.BlockAdapter
Request that the thread block, for this block adapter, at its earliest convenience. Called from RVMThread.block() and associated methods. Some block adapters allow for multiple requests to block; in that case this will return a "token" that can be passed to hasBlockRequest() to check, not only whether there is a block request, but whether that block request is still associated with a particular call to requestBlock(). This is used to prevent a suspend() call from stalling due to a concurrent resume() and second suspend(). Note that most block adapers don't care about this scenario, and will just return 0 (or some other meaningless number) here.

Specified by:
requestBlock in class RVMThread.BlockAdapter

hasBlockRequest

boolean hasBlockRequest(RVMThread t)
Description copied from class: RVMThread.BlockAdapter
Does the thread have a request to block for this block adapter?

Specified by:
hasBlockRequest in class RVMThread.BlockAdapter

hasBlockRequest

boolean hasBlockRequest(RVMThread t,
                        int token)
Description copied from class: RVMThread.BlockAdapter
Does the thread have a request to block associated with the given requestBlock() call?

Specified by:
hasBlockRequest in class RVMThread.BlockAdapter

clearBlockRequest

void clearBlockRequest(RVMThread t)
Description copied from class: RVMThread.BlockAdapter
Clear any blocking requests.

Specified by:
clearBlockRequest in class RVMThread.BlockAdapter