Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix inf loop in AtomicDouble.max (#874)
Before, if there was contention and the body of the loop was accessed, then it could result in an infinite loop because it accessed the raw value from the AtomicLong rather than convert the bits to a double. If the long bits for `v` treated as a long that is coerced to a double is smaller than `v`, then the loop condition will never be satisfied and it loops forever. Not sure of a good test case to hit this, but the loop behavior can be reproduced by initializing the max to the raw long bits and running the `maxNegative` test.
- Loading branch information