Commit Graph

2 Commits

Author SHA1 Message Date
Bung
04254fe9d6 fix #12726 Cannot take the compile-time sizeof Atomic types (#15928)
* fix #12726 Cannot take the compile-time sizeof Atomic types

* fix for arch 32

(cherry picked from commit 826e62953f)
2020-11-16 06:56:33 +01:00
Elijah Shaw-Rutschman
8a004e2fc0 Add test coverage for atomics (#15193)
* Add test coverage for atomics

Signed-off-by: Elijah Shaw-Rutschman <elijahr@gmail.com>

* Fix compareExchange bugs for non-trivial objects

Bugs fixed:

1. compareExchange would not set the desired value in the success case.
2. compareExchange would not set var expected to the found value in the failure case.
3. withLock would spin forever running the unit tests. try..body..finally prevents this. Not sure why this makes a difference, since an exception wasn’t being raised, but clearing the guard in a finally block seems correct anyways.

Signed-off-by: Elijah Shaw-Rutschman <elijahr@gmail.com>
2020-08-18 18:02:10 +02:00