Package com.j_spaces.kernel.list
Class RwlLocksPool
java.lang.Object
com.j_spaces.kernel.list.RwlLocksPool
- All Implemented Interfaces:
IReusableResourcePool<ReadWriteLock>
Maintains a pool of ReadWriteLock lockers, used by SLs in order to avoid creating an expensive
lock per SL (i.e.- index value) used by classes like RwlSegmentedStoredList or RwlStoredList in
order to reduce memory footprint.
- Since:
- 5.0
- Version:
- 1.0
- Author:
- Yechiel Fefer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetResource(int index) intsize()get the number of resources in the pool
-
Constructor Details
-
RwlLocksPool
public RwlLocksPool(int numLocks)
-
-
Method Details
-
getResource
- Specified by:
getResourcein interfaceIReusableResourcePool<ReadWriteLock>- Returns:
- specific resource from the pool
-
getResource
- Specified by:
getResourcein interfaceIReusableResourcePool<ReadWriteLock>- Returns:
- one of the resources in the pool
-
size
public int size()get the number of resources in the pool- Specified by:
sizein interfaceIReusableResourcePool<ReadWriteLock>- Returns:
- pool-size
-