|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Synchronization object providing mutual exclusion.
Mutex object supports nested locks, it means that if
some session locks mutex N
times, it should
unlock it N
time to release the mutex.
Server is able to detect deadlock for mutexes.
Semantic of methods inherited from JIPCPrimitive
:
waitFor
reset
reset
method be owner
of the mutex
Field Summary |
Fields inherited from interface org.garret.jipc.JIPCPrimitive |
DEFAULT_RANK |
Method Summary | |
void |
lock()
Lock mutex. |
boolean |
lock(long timeout)
Try to lock the mutex with specified timeout. |
void |
priorityLock(int rank)
Lock mutex. |
boolean |
priorityLock(int rank,
long timeout)
Try to lock the mutex with specified timeout. |
void |
unlock()
Unlock mutex. |
Methods inherited from interface org.garret.jipc.JIPCPrimitive |
alreadyExists, close, getName, priorityWait, priorityWait, reset, waitFor, waitFor |
Method Detail |
public void lock() throws JIPCException, java.io.IOException
JIPCException
java.io.IOException
public boolean lock(long timeout) throws JIPCException, java.io.IOException
timeout
- time in milliseconds
true
if lock is granted, false
of timeout
is expired
JIPCException
java.io.IOException
public void priorityLock(int rank) throws JIPCException, java.io.IOException
rank
- processes will be placed in wait queue in the order of increasing
rank value and in the same order will be taken from the queue.
JIPCException
java.io.IOException
public boolean priorityLock(int rank, long timeout) throws JIPCException, java.io.IOException
rank
- processes will be placed in wait queue in the order of increasing
rank value and in the same order will be taken from the queue.timeout
- time in milliseconds
true
if lock is granted, false
of timeout
is expired
JIPCException
java.io.IOException
public void unlock() throws JIPCException, java.io.IOException
JIPCException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |