Skip to content
Commit da0398d1 authored by Christopher Friedt's avatar Christopher Friedt Committed by Carles Cufi
Browse files

posix: pthread: consider PTHREAD_EXITED state in pthread_create



If a thread is joined using `pthread_join()`, then the
internal state would be set to `PTHREAD_EXITED`.

Previously, `pthread_create()` would only consider pthreads
with internal state `PTHREAD_TERMINATED` as candidates for new
threads. However, that causes a descriptor leak.

We should be able to reuse a single thread an infinite number
of times.

Here, we also consider threads with internal state
`PTHREAD_EXITED` as candiates in `pthread_create()`.

Fixes #47609

Signed-off-by: default avatarChristopher Friedt <cfriedt@fb.com>
parent dbe8a3ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment