98 |
|
/** |
99 |
|
* The default concurrency level for this table, used when not |
100 |
|
* otherwise specified in a constructor. |
101 |
< |
**/ |
101 |
> |
*/ |
102 |
|
static final int DEFAULT_CONCURRENCY_LEVEL = 16; |
103 |
|
|
104 |
|
/** |
128 |
|
/** |
129 |
|
* Mask value for indexing into segments. The upper bits of a |
130 |
|
* key's hash code are used to choose the segment. |
131 |
< |
**/ |
131 |
> |
*/ |
132 |
|
final int segmentMask; |
133 |
|
|
134 |
|
/** |
135 |
|
* Shift value for indexing within segments. |
136 |
< |
**/ |
136 |
> |
*/ |
137 |
|
final int segmentShift; |
138 |
|
|
139 |
|
/** |
203 |
|
* Segments are specialized versions of hash tables. This |
204 |
|
* subclasses from ReentrantLock opportunistically, just to |
205 |
|
* simplify some locking and avoid separate construction. |
206 |
< |
**/ |
206 |
> |
*/ |
207 |
|
static final class Segment<K,V> extends ReentrantLock implements Serializable { |
208 |
|
/* |
209 |
|
* Segments maintain a table of entry lists that are ALWAYS |
246 |
|
|
247 |
|
/** |
248 |
|
* The number of elements in this segment's region. |
249 |
< |
**/ |
249 |
> |
*/ |
250 |
|
transient volatile int count; |
251 |
|
|
252 |
|
/** |
288 |
|
/** |
289 |
|
* Set table to new HashEntry array. |
290 |
|
* Call only while holding lock or in constructor. |
291 |
< |
**/ |
291 |
> |
*/ |
292 |
|
void setTable(HashEntry[] newTable) { |
293 |
|
threshold = (int)(newTable.length * loadFactor); |
294 |
|
table = newTable; |