* rte_atomicXX_dec_and_test() should decrease a 32 bits counter by one and then * test if that counter is equal to 0. It should return true if the counter is 0 * and false if the counter is not 0. * This test checks if the counter is equal to 0 after being atomically * decreased by one. If it is, increase the value of "count" by one which is to * be checked as the result later. */
| 233 | * be checked as the result later. |
| 234 | */ |
| 235 | static int |
| 236 | test_atomic_dec_and_test(__rte_unused void *arg) |
| 237 | { |
| 238 | while (rte_atomic32_read(&synchro) == 0) |
| 239 | ; |
| 240 | |
| 241 | if (rte_atomic16_dec_and_test(&a16)) |
| 242 | rte_atomic64_inc(&count); |
| 243 | |
| 244 | if (rte_atomic32_dec_and_test(&a32)) |
| 245 | rte_atomic64_inc(&count); |
| 246 | |
| 247 | if (rte_atomic64_dec_and_test(&a64)) |
| 248 | rte_atomic64_inc(&count); |
| 249 | |
| 250 | return 0; |
| 251 | } |
| 252 | |
| 253 | #if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_ARM64) |
| 254 | static rte_int128_t count128; |
nothing calls this directly
no test coverage detected