EDU.oswego.cs.dl.util.concurrent
public class SyncMap extends Object implements Map
Reader operations are
Field Summary | |
---|---|
protected Map | c_ |
protected Sync | rd_ |
protected SynchronizedLong | syncFailures_ |
protected Sync | wr_ |
Constructor Summary | |
---|---|
SyncMap(Map map, Sync sync)
Create a new SyncMap protecting the given map,
and using the given sync to control both reader and writer methods.
| |
SyncMap(Map map, ReadWriteLock rwl)
Create a new SyncMap protecting the given map,
and using the given ReadWriteLock to control reader and writer methods.
| |
SyncMap(Map map, Sync readLock, Sync writeLock)
Create a new SyncMap protecting the given map,
and using the given pair of locks to control reader and writer methods.
|
Method Summary | |
---|---|
protected void | afterRead(boolean wasInterrupted) Clean up after a reader operation * |
protected boolean | beforeRead() Try to acquire sync before a reader operation; record failure * |
void | clear() |
boolean | containsKey(Object o) |
boolean | containsValue(Object o) |
Set | entrySet() |
boolean | equals(Object o) |
Object | get(Object key) |
int | hashCode() |
boolean | isEmpty() |
Set | keySet() |
Object | put(Object key, Object value) |
void | putAll(Map coll) |
Sync | readerSync()
Return the Sync object managing read-only operations
|
Object | remove(Object key) |
int | size() |
long | syncFailures()
Return the number of synchronization failures for read-only operations
|
Collection | values() |
Sync | writerSync()
Return the Sync object managing mutative operations
|