[dpdk-dev] [dpdk-stable] [PATCH] vdpa/mlx5: fix configuration mutex cleanup

Matan Azrad matan at nvidia.com
Thu Jan 14 12:49:19 CET 2021


Hi Maxime and David

Thank you for Review.

From: David Marchand
> On Fri, Jan 8, 2021 at 9:48 AM David Marchand
> <david.marchand at redhat.com> wrote:
> > > I wonder if it would be possible and cleaner to disable cancellation
> > > on the thread while the mutex is held?

Yes, we can cause thread to return by some global variable sync.
It is the same logic.

> > +1
> 
> IEEE Std 1003.1-2001/Cor 2-2004, item XBD/TC2/D6/26 is applied, adding
> pthread_t to the list of types that are not required to be arithmetic types, thus
> allowing pthread_t to be defined as a structure.
> 
> It would be better to leave pthread_t alone and not interpret it:
> 
> if (priv->timer_tid) {
>     pthread_cancel(priv->timer_tid);
>     pthread_join(priv->timer_tid, &status); }
> priv->timer_tid = 0;


I'm not sure why you think it is better in this specific case.
The cancellation will close the thread in faster way, no need to wait for the thread to close itself.


> 
> --
> David Marchand



More information about the dev mailing list