| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | Striped64.Cell
Padded variant of AtomicLong supporting only raw accesses plus CAS. |
| pack-priv static class | Striped64.HashCode
Holder for the thread-local hash code. |
| pack-priv static class | Striped64.ThreadHashCode
The corresponding ThreadLocal class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv transient volatile long | base
Base value, used mainly when there is no contention, but also as a fallback during table initialization races. |
| pack-priv static final AtomicLongFieldUpdater | |
| pack-priv transient volatile int | busy
Spinlock (locked via CAS) used when resizing and/or creating Cells. |
| pack-priv static final AtomicIntegerFieldUpdater | |
| pack-priv transient volatile Striped64. | cells
Table of cells. |
| pack-priv static final int | NCPU
Number of CPUS, to place bound on table size |
| pack-priv static final Striped64. | threadHashCode
Static per-thread hash codes. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv abstract long | Returns: result of the update functionthe current value (of either base or a cell) currentValue, long the argument from a user update call newValue)Computes the function of current and new value. |
| pack-priv final void | |
| pack-priv final void | retryUpdate(long
the value x, Striped64.the hash code holder hc,false if CAS failed before call wasUncontended)Handles cases of updates involving initialization, resizing, creating new Cells, and/or contention. |
| base | back to summary |
|---|---|
| pack-priv transient volatile long base Base value, used mainly when there is no contention, but also as a fallback during table initialization races. Updated via CAS. | |
| BASE_UPDATER | back to summary |
|---|---|
| pack-priv static final AtomicLongFieldUpdater<Striped64> BASE_UPDATER | |
| busy | back to summary |
|---|---|
| pack-priv transient volatile int busy Spinlock (locked via CAS) used when resizing and/or creating Cells. | |
| BUSY_UPDATER | back to summary |
|---|---|
| pack-priv static final AtomicIntegerFieldUpdater<Striped64> BUSY_UPDATER | |
| cells | back to summary |
|---|---|
| pack-priv transient volatile Striped64. Table of cells. When non-null, size is a power of 2. | |
| NCPU | back to summary |
|---|---|
| pack-priv static final int NCPU Number of CPUS, to place bound on table size | |
| threadHashCode | back to summary |
|---|---|
| pack-priv static final Striped64. Static per-thread hash codes. Shared across all instances to reduce ThreadLocal pollution and because adjustments due to collisions in one table are likely to be appropriate for others. | |
| Striped64 | back to summary |
|---|---|
| pack-priv Striped64() Package-private default constructor | |
| casBase | back to summary |
|---|---|
| pack-priv final boolean casBase(long cmp, long val) CASes the base field. | |
| casBusy | back to summary |
|---|---|
| pack-priv final boolean casBusy() CASes the busy field from 0 to 1 to acquire lock. | |
| fn | back to summary |
|---|---|
| pack-priv abstract long fn(long currentValue, long newValue) Computes the function of current and new value. Subclasses should open-code this update function for most uses, but the virtualized form is needed within retryUpdate.
| |
| internalReset | back to summary |
|---|---|
| pack-priv final void internalReset(long initialValue) Sets base and all cells to the given value. | |
| retryUpdate | back to summary |
|---|---|
| pack-priv final void retryUpdate(long x, Striped64. Handles cases of updates involving initialization, resizing, creating new Cells, and/or contention. See above for explanation. This method suffers the usual non-modularity problems of optimistic retry code, relying on rechecked sets of reads. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| pack-priv volatile long | |
| private static final AtomicLongFieldUpdater |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final boolean |
| p0 | back to summary |
|---|---|
| pack-priv volatile long p0 | |
| p1 | back to summary |
|---|---|
| pack-priv volatile long p1 | |
| p2 | back to summary |
|---|---|
| pack-priv volatile long p2 | |
| p3 | back to summary |
|---|---|
| pack-priv volatile long p3 | |
| p4 | back to summary |
|---|---|
| pack-priv volatile long p4 | |
| p5 | back to summary |
|---|---|
| pack-priv volatile long p5 | |
| p6 | back to summary |
|---|---|
| pack-priv volatile long p6 | |
| q0 | back to summary |
|---|---|
| pack-priv volatile long q0 | |
| q1 | back to summary |
|---|---|
| pack-priv volatile long q1 | |
| q2 | back to summary |
|---|---|
| pack-priv volatile long q2 | |
| q3 | back to summary |
|---|---|
| pack-priv volatile long q3 | |
| q4 | back to summary |
|---|---|
| pack-priv volatile long q4 | |
| q5 | back to summary |
|---|---|
| pack-priv volatile long q5 | |
| q6 | back to summary |
|---|---|
| pack-priv volatile long q6 | |
| value | back to summary |
|---|---|
| pack-priv volatile long value | |
| VALUE_UPDATER | back to summary |
|---|---|
| private static final AtomicLongFieldUpdater<Striped64. | |
| Cell | back to summary |
|---|---|
| pack-priv Cell(long x) | |
| cas | back to summary |
|---|---|
| pack-priv final boolean cas(long cmp, long val) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv static final Random |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| code | back to summary |
|---|---|
| pack-priv int code | |
| rng | back to summary |
|---|---|
| pack-priv static final Random rng | |
| HashCode | back to summary |
|---|---|
| pack-priv HashCode() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Striped64. | initialValue()
Overrides java. |
| ThreadHashCode | back to summary |
|---|---|
| pack-priv ThreadHashCode() | |
| initialValue | back to summary |
|---|---|
| public Striped64. Overrides java. Doc from java. Returns the current thread's "initial value" for this
thread-local variable. This method will be invoked the first
time a thread accesses the variable with the | |