|
NetKernel APIs |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ten60.netkernel.util.AsynchLock
public class AsynchLock
Atomic lock request and aquire. unlock might return a released previously unaquired lock request if one
exists.
not thread safe- external synchronization must be provided.
| Constructor Summary | |
|---|---|
AsynchLock(int aKeyCount,
int aContentionCount)
Creates a new instance of AsynchLock |
|
| Method Summary | |
|---|---|
java.util.Iterator |
getPendingReferences()
returns an iterator over all pending lock request references |
boolean |
lock(java.lang.Object aKey,
java.lang.Object aReference)
Attempt to gain an exclusive lock on the given key, takes a reference object to hang onto if the lock fails to be granted that is then returned on an unlock when the lock has been granted |
java.lang.Object |
unlock(java.lang.Object aKey)
releases a lock on the given key, this method must only be called after a lock has been granted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsynchLock(int aKeyCount,
int aContentionCount)
aKeyCount - size to make lock mapaContentionCount - expected lock contention count- so as to allocate a list long enough to hold them without needing to expand| Method Detail |
|---|
public boolean lock(java.lang.Object aKey,
java.lang.Object aReference)
aKey - the key object that we want to gain an exclusive lock onaReference - a reference object for the request to lock
public java.lang.Object unlock(java.lang.Object aKey)
aKey - the key object that we are releasing the exclusive lock on
public java.util.Iterator getPendingReferences()
|
NetKernel APIs |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||