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

Function test_ticketlock_try

dpdk/app/test/test_ticketlock.c:186–196  ·  view source on GitHub ↗

* Use rte_ticketlock_trylock() to trylock a ticketlock object, * If it could not lock the object successfully, it would * return immediately and the variable of "count" would be * increased by one per times. the value of "count" could be * checked as the result later. */

Source from the content-addressed store, hash-verified

184 * checked as the result later.
185 */
186static int
187test_ticketlock_try(__rte_unused void *arg)
188{
189 if (rte_ticketlock_trylock(&tl_try) == 0) {
190 rte_ticketlock_lock(&tl);
191 count++;
192 rte_ticketlock_unlock(&tl);
193 }
194
195 return 0;
196}
197
198
199/*

Callers

nothing calls this directly

Calls 3

rte_ticketlock_trylockFunction · 0.85
rte_ticketlock_lockFunction · 0.85
rte_ticketlock_unlockFunction · 0.85

Tested by

no test coverage detected