public abstract static class RVMThread.BlockAdapter extends Object
Constructor and Description |
---|
BlockAdapter() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
clearBlockRequest(RVMThread t)
Clears any blocking requests for the thread.
|
(package private) abstract boolean |
hasBlockRequest(RVMThread t) |
(package private) abstract boolean |
hasBlockRequest(RVMThread t,
int token) |
(package private) abstract boolean |
isBlocked(RVMThread t) |
(package private) abstract int |
requestBlock(RVMThread t)
Requests that the thread block, for this block adapter, at its earliest
convenience.
|
(package private) abstract void |
setBlocked(RVMThread t,
boolean value)
Specifies that the thread is either blocked
(value == true) or not
blocked (value == false) for this block adapter. |
public BlockAdapter()
abstract boolean isBlocked(RVMThread t)
t
- a threadtrue
, the thread is guaranteed to block.abstract void setBlocked(RVMThread t, boolean value)
(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(RVMThread)
below) or to respond to a request to unblock.t
- the threadvalue
- the new value of the status for blocking as described aboveabstract int requestBlock(RVMThread t)
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.
t
- the thread that needs to blockabstract boolean hasBlockRequest(RVMThread t)
t
- the threadabstract boolean hasBlockRequest(RVMThread t, int token)
t
- the thread to check for block requeststoken
- a token, see requestBlock(RVMThread)
abstract void clearBlockRequest(RVMThread t)
t
- thread whose block requests will be cleared