diff options
author | Sam Gross <colesbury@gmail.com> | 2024-02-06 19:45:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 19:45:04 (GMT) |
commit | b6228b521b4692b2de1c1c12f4aa5623f8319084 (patch) | |
tree | a173751e1e7882a755bf6d2b75e38ac833430fd6 /Python/thread_pthread.h | |
parent | 71239d50b54c90afd3fdde260848e0c6d73a5c27 (diff) | |
download | cpython-b6228b521b4692b2de1c1c12f4aa5623f8319084.zip cpython-b6228b521b4692b2de1c1c12f4aa5623f8319084.tar.gz cpython-b6228b521b4692b2de1c1c12f4aa5623f8319084.tar.bz2 |
gh-115035: Mark ThreadHandles as non-joinable earlier after forking (#115042)
This marks dead ThreadHandles as non-joinable earlier in
`PyOS_AfterFork_Child()` before we execute any Python code. The handles
are stored in a global linked list in `_PyRuntimeState` because `fork()`
affects the entire process.
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r-- | Python/thread_pthread.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index fb3b79f..556e3de 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -339,16 +339,6 @@ PyThread_detach_thread(PyThread_handle_t th) { return pthread_detach((pthread_t) th); } -void -PyThread_update_thread_after_fork(PyThread_ident_t* ident, PyThread_handle_t* handle) { - // The thread id might have been updated in the forked child - pthread_t th = pthread_self(); - *ident = (PyThread_ident_t) th; - *handle = (PyThread_handle_t) th; - assert(th == (pthread_t) *ident); - assert(th == (pthread_t) *handle); -} - /* XXX This implementation is considered (to quote Tim Peters) "inherently hosed" because: - It does not guarantee the promise that a non-zero integer is returned. |