src/dpdk/lib/librte_eal/include/generic/rte_ticketlock.h
static inline int
rte_ticketlock_recursive_trylock(rte_ticketlock_recursive_t *tlr)
{
	int id = rte_gettid();

	if (__atomic_load_n(&tlr->user, __ATOMIC_RELAXED) != id) {
		if (rte_ticketlock_trylock(&tlr->tl) == 0)
			return 0;
		__atomic_store_n(&tlr->user, id, __ATOMIC_RELAXED);
	}
	tlr->count++;
	return 1;
}
/**
 * Try to take the recursive lock.
 *
 * @param tlr
 *   A pointer to the recursive ticketlock.
 * @return
 *   1 if the lock is successfully taken; 0 otherwise.
 */
Try to take the recursive lock.
@param tlr
A pointer to the recursive ticketlock.
@return
1 if the lock is successfully taken; 0 otherwise.
Try to take the recursive lock . @param tlr A pointer to the recursive ticketlock . @return 1 if the lock is successfully taken ; 0 otherwise .
static inline int
rte_ticketlock_recursive_trylock(rte_ticketlock_recursive_t *tlr)
{
	int id = rte_gettid();
	if (__atomic_load_n(&tlr->user, __ATOMIC_RELAXED) != id) {
		if (rte_ticketlock_trylock(&tlr->tl) == 0)
			return 0;
		__atomic_store_n(&tlr->user, id, __ATOMIC_RELAXED);
	}
	tlr->count++;
	return 1;
}
static inline int rte_ticketlock_recursive_trylock ( rte_ticketlock_recursive_t * tlr ) { int id = rte_gettid ( ) ; if ( __atomic_load_n ( & tlr -> user , __ATOMIC_RELAXED ) != id ) { if ( rte_ticketlock_trylock ( & tlr -> tl ) == 0 ) return 0 ; __atomic_store_n ( & tlr -> user , id , __ATOMIC_RELAXED ) ; } tlr -> count ++ ; return 1 ; }
Try to take the recursive lock.
Try to take the recursive lock .