diff options
author | Antoine Pitrou <antoine@python.org> | 2023-11-04 14:59:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-04 13:59:24 +0000 |
commit | 0e9c364f4ac18a2237bdbac702b96bcf8ef9cb09 (patch) | |
tree | 8febb8282c2c1ebd73a18205ec5b9229a99ac4fe /Python/thread_pthread_stubs.h | |
parent | a28a3967ab9a189122f895d51d2551f7b3a273b0 (diff) | |
download | cpython-0e9c364f4ac18a2237bdbac702b96bcf8ef9cb09.tar.gz cpython-0e9c364f4ac18a2237bdbac702b96bcf8ef9cb09.zip |
GH-110829: Ensure Thread.join() joins the OS thread (#110848)
Joining a thread now ensures the underlying OS thread has exited. This is required for safer fork() in multi-threaded processes.
---------
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Python/thread_pthread_stubs.h')
-rw-r--r-- | Python/thread_pthread_stubs.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/thread_pthread_stubs.h b/Python/thread_pthread_stubs.h index 48bad36ec44..4741e594e52 100644 --- a/Python/thread_pthread_stubs.h +++ b/Python/thread_pthread_stubs.h @@ -94,6 +94,15 @@ pthread_detach(pthread_t thread) return 0; } +int +pthread_join(pthread_t thread, void** value_ptr) +{ + if (value_ptr) { + *value_ptr = NULL; + } + return 0; +} + PyAPI_FUNC(pthread_t) pthread_self(void) { return 0; |