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

Function rte_ticketlock_lock

dpdk/lib/eal/include/rte_ticketlock.h:63–69  ·  view source on GitHub ↗

* Take the ticketlock. * * @param tl * A pointer to the ticketlock. */

Source from the content-addressed store, hash-verified

61 * A pointer to the ticketlock.
62 */
63static inline void
64rte_ticketlock_lock(rte_ticketlock_t *tl)
65{
66 uint16_t me = rte_atomic_fetch_add_explicit(&tl->s.next, 1, rte_memory_order_relaxed);
67 rte_wait_until_equal_16((uint16_t *)(uintptr_t)&tl->s.current, me,
68 rte_memory_order_acquire);
69}
70
71/**
72 * Release the ticketlock.

Callers 5

test_ticketlock_per_coreFunction · 0.85
load_loop_fnFunction · 0.85
test_ticketlock_tryFunction · 0.85
test_ticketlockFunction · 0.85

Calls 1

rte_wait_until_equal_16Function · 0.50

Tested by 4

test_ticketlock_per_coreFunction · 0.68
load_loop_fnFunction · 0.68
test_ticketlock_tryFunction · 0.68
test_ticketlockFunction · 0.68