summaryrefslogtreecommitdiffstats
path: root/Python/context.c
diff options
context:
space:
mode:
authormpage <mpage@meta.com>2024-03-01 21:43:12 (GMT)
committerGitHub <noreply@github.com>2024-03-01 21:43:12 (GMT)
commit9e88173d363fb22c2c7bf3da3a266817db6bf24b (patch)
treedec22e7ab1b7d7815490b8a3fecbe68392ad42e4 /Python/context.c
parent5e0c7bc1d311048e8252bae6fc91cb51c556f807 (diff)
downloadcpython-9e88173d363fb22c2c7bf3da3a266817db6bf24b.zip
cpython-9e88173d363fb22c2c7bf3da3a266817db6bf24b.tar.gz
cpython-9e88173d363fb22c2c7bf3da3a266817db6bf24b.tar.bz2
gh-114271: Make `_thread.ThreadHandle` thread-safe in free-threaded builds (GH-115190)
Make `_thread.ThreadHandle` thread-safe in free-threaded builds We protect the mutable state of `ThreadHandle` using a `_PyOnceFlag`. Concurrent operations (i.e. `join` or `detach`) on `ThreadHandle` block until it is their turn to execute or an earlier operation succeeds. Once an operation has been applied successfully all future operations complete immediately. The `join()` method is now idempotent. It may be called multiple times but the underlying OS thread will only be joined once. After `join()` succeeds, any future calls to `join()` will succeed immediately. The internal thread handle `detach()` method has been removed.
Diffstat (limited to 'Python/context.c')
0 files changed, 0 insertions, 0 deletions