```
class G1CardSetArrayLocker : public StackObj {
EntryCountType volatile* _value;
EntryCountType volatile _original_value;
bool _success;
...
}
```
Using `value` in field names is too abstract; since this class only used to capture `num_entries`, these field names can be made more explicit.
`_original_value` is only accessed by the thread holding the lock, so it should *not* be `volatile`.
`bool _success` is used as a one-bit integer to increment `num_entries` by 0 or 1, which works fine, but can be a bit confusing. Instead, one can increment `_original_value` directly.
class G1CardSetArrayLocker : public StackObj {
EntryCountType volatile* _value;
EntryCountType volatile _original_value;
bool _success;
...
}
```
Using `value` in field names is too abstract; since this class only used to capture `num_entries`, these field names can be made more explicit.
`_original_value` is only accessed by the thread holding the lock, so it should *not* be `volatile`.
`bool _success` is used as a one-bit integer to increment `num_entries` by 0 or 1, which works fine, but can be a bit confusing. Instead, one can increment `_original_value` directly.