Skip to content
Commit 018f836c authored by Christopher Friedt's avatar Christopher Friedt Committed by Christopher Friedt
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>
(cherry picked from commit da0398d1)
parent f4466c47
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment