On Fri, Mar 17, 2023 at 7:52 PM David Marchand <[email protected]> wrote: > > From: Tyler Retzlaff <[email protected]> > > In rte_thread_create setting affinity after pthread_create may fail. > Such a failure should result in the entire rte_thread_create failing > but doesn't. > > Additionally if there is a failure to set affinity a race exists where > the creating thread will free ctx and depending on scheduling of the new > thread it may also free ctx (double free). > > Resolve the above by setting the affinity from the newly created thread > using a condition variable to signal the completion of the thread > start wrapper having completed. > > Since we are now waiting for the thread start wrapper to complete we can > allocate the thread start wrapper context on the stack. While here clean > up the variable naming in the context to better highlight the fields of > the context require synchronization between the creating and created > thread. > > Fixes: ce6e911d20f6 ("eal: add thread lifetime API") > Cc: [email protected] > > Signed-off-by: Tyler Retzlaff <[email protected]> > Signed-off-by: David Marchand <[email protected]>
Applied thanks. -- David Marchand

