* Peterson lock implementation. */
| 84 | * Peterson lock implementation. |
| 85 | */ |
| 86 | static void |
| 87 | plock_lock(struct plock *l, uint32_t self) |
| 88 | { |
| 89 | uint32_t other; |
| 90 | |
| 91 | other = self ^ 1; |
| 92 | |
| 93 | l->flag[self] = 1; |
| 94 | rte_smp_wmb(); |
| 95 | l->victim = self; |
| 96 | |
| 97 | store_load_barrier(l->utype); |
| 98 | |
| 99 | while (l->flag[other] == 1 && l->victim == self) |
| 100 | rte_pause(); |
| 101 | rte_smp_rmb(); |
| 102 | } |
| 103 | |
| 104 | static void |
| 105 | plock_unlock(struct plock *l, uint32_t self) |
no test coverage detected