[PATCH] spinlock: remove volatile qualifier

Thomas Monjalon thomas at monjalon.net
Mon May 4 11:06:02 CEST 2026


04/05/2026 10:37, Thomas Monjalon:
> The user and count fields of rte_spinlock_recursive_t
> do not need the volatile qualifier
> because they are only accessed by the thread holding the lock,
> which already provides the necessary memory ordering.
> 
> Removing volatile aligns with a C++20 deprecation
> for increment and decrement of volatile variables.
> 
> This issue was seen with GCC 16 which changes the default C++ version
> from -std=gnu++17 to -std=gnu++20.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>

I've just found this has been discussed 4 years ago:
https://inbox.dpdk.org/dev/20221221083717.135c3f81@hermes.local

Stephen had found some comments issues that I will fix in another patch.




More information about the dev mailing list