[PATCH v2 2/2] random: make rte_rand() thread safe for non-EAL threads

Stephen Hemminger stephen at networkplumber.org
Thu Sep 7 17:47:43 CEST 2023


On Thu,  7 Sep 2023 08:24:56 -0700
Stephen Hemminger <stephen at networkplumber.org> wrote:

>  
> +static __rte_always_inline
> +void __rte_rand_put_state(struct rte_rand_state *state)
> +{
> +	if (state == &rand_states[RTE_MAX_LCORE])
> +		rte_spinlock_unlock(&rte_rand_lock);
> +}

Conditional locking like this make clang lock analyzer unhappy though.


More information about the dev mailing list