[ovs-dev] [PATCHv16 1/2] ovs-thread: Add pthread spin lock support.

Ben Pfaff blp at ovn.org
Mon Jul 15 18:54:39 UTC 2019


On Mon, Jul 15, 2019 at 05:28:44PM +0300, Ilya Maximets wrote:
> On 13.07.2019 2:50, William Tu wrote:
> > The patch adds the basic spin lock functions:
> > ovs_spin_{lock, try_lock, unlock, init, destroy}.
> > OSX does not support pthread spin lock, so make it
> > linux only.
> 
> IIUC, pthread spinlock requires some specific glibc verions (>= 2.2)
> so it could be not supported even on Linux. Instead of checking
> _POSIX_C_SOURCE version, I think it's better to just check for
> pthread_spin_lock function in configure script with AC_CHECK_FUNC and
> check for the resulted macro.
> Additionally we could check for this macro while checking AF_XDP support
> to not enable it if we have no spinlocks.

glibc 2.2 was released in 2000.  I don't think that it is worth worrying
that a user might have such an ancient version of glibc.

However, I think that feature checks are generally better, so I support
the change.


More information about the dev mailing list