public class MutexState extends SEMState
MAX_STATE, MIN_STATE, sem, STATE_DESC, STATE_INVALID, STATE_POSTED, STATE_RELEASED, STATE_REQUESTED, STATE_RESET, STATE_WAITING
Constructor and Description |
---|
MutexState(java.lang.String itemname,
int itemstate) |
Modifier and Type | Method and Description |
---|---|
boolean |
isAvailable() |
com.ibm.staf.STAFResult |
releaseMutex(java.lang.String holder)
Release 1 (and only 1) Mutex waiter currently registered for the item.
|
void |
releaseWaiters()
Used internally.
|
com.ibm.staf.STAFResult |
requestMutex(java.lang.String holder)
Request exclusive ownership of the Mutex.
Calling thread will be blocked until access is granted. |
addWaiter, addWaiter, addWaiterId, getItemName, getItemState, getStateDesc, getWaiterIds, hasWaiters, removeWaiterId, setItemState
public MutexState(java.lang.String itemname, int itemstate)
itemname
- itemstate
- public void releaseWaiters()
Release 1 (and only 1) waiter currently registered for the item.
Called by releaseMutex
releaseWaiters
in class SEMState
MutexState#releaseMutex()
public boolean isAvailable()
public com.ibm.staf.STAFResult requestMutex(java.lang.String holder) throws java.lang.InterruptedException
holder
- java.lang.InterruptedException
- if the waiting thread is interrupted.public com.ibm.staf.STAFResult releaseMutex(java.lang.String holder)
Only the owner of the Mutex can release it.
Copyright © SAS Institute. All Rights Reserved.