MCPcopy Create free account
hub / github.com/F-Stack/f-stack / plock_lock

Function plock_lock

dpdk/app/test/test_barrier.c:86–102  ·  view source on GitHub ↗

* Peterson lock implementation. */

Source from the content-addressed store, hash-verified

84 * Peterson lock implementation.
85 */
86static void
87plock_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
104static void
105plock_unlock(struct plock *l, uint32_t self)

Callers 1

plock_addFunction · 0.85

Calls 2

store_load_barrierFunction · 0.85
rte_pauseFunction · 0.50

Tested by

no test coverage detected