returns old value
| 103 | |
| 104 | // returns old value |
| 105 | counter_type exchangeLower(counter_type val) |
| 106 | { |
| 107 | while (true) |
| 108 | { |
| 109 | counter_type oldVal = counter.load(std::memory_order_acquire); |
| 110 | |
| 111 | if (oldVal <= val) |
| 112 | return oldVal; |
| 113 | |
| 114 | if (counter.compare_exchange_strong(oldVal, val)) |
| 115 | return oldVal; |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void operator &=(counter_type val) |
| 120 | { |
no test coverage detected