returns old value
| 88 | |
| 89 | // returns old value |
| 90 | counter_type exchangeGreater(counter_type val) |
| 91 | { |
| 92 | while (true) |
| 93 | { |
| 94 | counter_type oldVal = counter.load(std::memory_order_acquire); |
| 95 | |
| 96 | if (oldVal >= val) |
| 97 | return oldVal; |
| 98 | |
| 99 | if (counter.compare_exchange_strong(oldVal, val)) |
| 100 | return oldVal; |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // returns old value |
| 105 | counter_type exchangeLower(counter_type val) |
nothing calls this directly
no test coverage detected