public class SafeLongArray<V> extends AbstractSafeLongArray<V>
LongArray
in which is protected by a ReentrantLock.
This implementation is suitable for workloads where the read to write ratio is close to 1:1, or where writes are
more common then reads. For read heavy workloads the ReadHeavyLongArray
is likely to be a better choice.AbstractSafeLongArray.SafeIterator
LongArray.Iterator<V>
Modifier and Type | Field and Description |
---|---|
protected com.oracle.coherence.common.util.AutoLock<LongArray<V>> |
f_lock
The lock to hold during read and write operations.
|
NO_VALUE
Constructor and Description |
---|
SafeLongArray()
Construct a new SafeLongArray.
|
SafeLongArray(LongArray<V> laDelegate)
Construct a new SafeLongArray around the specified delegate.
|
Modifier and Type | Method and Description |
---|---|
protected com.oracle.coherence.common.util.AutoLock.Sentry<LongArray<V>> |
acquireReadLock()
Acquire the read lock.
|
protected com.oracle.coherence.common.util.AutoLock.Sentry<LongArray<V>> |
acquireWriteLock()
Acquire the write lock.
|
SafeLongArray<V> |
clone()
Make a clone of the LongArray.
|
com.oracle.coherence.common.util.AutoLock<LongArray<V>> |
getLock()
Return the lock used to protect this LongArray, with the unsafe delegate as its
resource . |
add, ceiling, ceilingIndex, clear, contains, exists, floor, floorIndex, get, getFirstIndex, getLastIndex, getSize, indexOf, indexOf, instantiateSafeIterator, isEmpty, iterator, iterator, lastIndexOf, lastIndexOf, remove, remove, reverseIterator, reverseIterator, set, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public com.oracle.coherence.common.util.AutoLock<LongArray<V>> getLock()
resource
.
Explicit usage of this lock is only necessary when performing multiple sequential operations against the LongArray which need to be "atomic".
public SafeLongArray<V> clone()
LongArray
protected com.oracle.coherence.common.util.AutoLock.Sentry<LongArray<V>> acquireReadLock()
AbstractSafeLongArray
acquireReadLock
in class AbstractSafeLongArray<V>
protected com.oracle.coherence.common.util.AutoLock.Sentry<LongArray<V>> acquireWriteLock()
AbstractSafeLongArray
acquireWriteLock
in class AbstractSafeLongArray<V>