protected class Locking.ClientLock extends java.lang.Object implements java.util.concurrent.locks.Lock, java.lang.Comparable<Locking.ClientLock>
Lock. This is a client stub communicates with a server equivalent. The semantics are
more or less those of Lock, but may differ slightly.
For details see LockService.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
acquired |
protected Locking.ClientCondition |
condition |
protected boolean |
denied |
protected boolean |
is_trylock |
protected int |
lock_id |
protected java.lang.String |
name |
protected Owner |
owner |
protected long |
timeout |
| Constructor and Description |
|---|
ClientLock(java.lang.String name) |
ClientLock(java.lang.String name,
Owner owner) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_unlock(boolean force) |
protected void |
_unlockOK() |
protected void |
acquire(boolean throwInterrupt) |
protected boolean |
acquireTryLock(long timeout,
boolean use_timeout) |
int |
compareTo(Locking.ClientLock o) |
protected void |
handleLockGrantedResponse(int lock_id) |
protected void |
handleLockReleasedResponse(int lock_id) |
void |
lock() |
protected void |
lockDenied(int lock_id) |
protected void |
lockGranted(int lock_id) |
void |
lockInterruptibly() |
java.util.concurrent.locks.Condition |
newCondition() |
java.lang.String |
toString() |
boolean |
tryLock() |
boolean |
tryLock(long time,
java.util.concurrent.TimeUnit unit) |
void |
unlock() |
protected final java.lang.String name
protected Owner owner
protected volatile boolean acquired
protected volatile boolean denied
protected volatile boolean is_trylock
protected long timeout
protected final Locking.ClientCondition condition
protected final int lock_id
public ClientLock(java.lang.String name)
public ClientLock(java.lang.String name,
Owner owner)
public void lock()
lock in interface java.util.concurrent.locks.Lockpublic void lockInterruptibly()
throws java.lang.InterruptedException
lockInterruptibly in interface java.util.concurrent.locks.Lockjava.lang.InterruptedExceptionpublic boolean tryLock()
tryLock in interface java.util.concurrent.locks.Lockpublic boolean tryLock(long time,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
tryLock in interface java.util.concurrent.locks.Lockjava.lang.InterruptedExceptionpublic void unlock()
unlock in interface java.util.concurrent.locks.Lockpublic java.util.concurrent.locks.Condition newCondition()
newCondition in interface java.util.concurrent.locks.Lockpublic java.lang.String toString()
toString in class java.lang.Objectprotected void lockGranted(int lock_id)
protected void lockDenied(int lock_id)
protected void handleLockGrantedResponse(int lock_id)
protected void handleLockReleasedResponse(int lock_id)
protected void acquire(boolean throwInterrupt)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprotected void _unlock(boolean force)
protected void _unlockOK()
protected boolean acquireTryLock(long timeout,
boolean use_timeout)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic int compareTo(Locking.ClientLock o)
compareTo in interface java.lang.Comparable<Locking.ClientLock>Copyright © 1998-2020 Red Hat. All Rights Reserved.