* rte_atomic32_inc_and_test() would increase a 32 bits counter by one and then * test if that counter is equal to 0. It would return true if the counter is 0 * and false if the counter is not 0. rte_atomic64_inc_and_test() could do the * same thing but for a 64 bits counter. * Here checks that if the 32/64 bits counter is equal to 0 after being atomically * increased by one. If it is, increas
| 206 | * |
| 207 | */ |
| 208 | static int |
| 209 | test_atomic_inc_and_test(__rte_unused void *arg) |
| 210 | { |
| 211 | while (rte_atomic32_read(&synchro) == 0) |
| 212 | ; |
| 213 | |
| 214 | if (rte_atomic16_inc_and_test(&a16)) { |
| 215 | rte_atomic64_inc(&count); |
| 216 | } |
| 217 | if (rte_atomic32_inc_and_test(&a32)) { |
| 218 | rte_atomic64_inc(&count); |
| 219 | } |
| 220 | if (rte_atomic64_inc_and_test(&a64)) { |
| 221 | rte_atomic64_inc(&count); |
| 222 | } |
| 223 | |
| 224 | return 0; |
| 225 | } |
| 226 | |
| 227 | /* |
| 228 | * rte_atomicXX_dec_and_test() should decrease a 32 bits counter by one and then |
nothing calls this directly
no test coverage detected