Closed
Description
Feature or enhancement
The defaulttimeout
in socketmodule.c
is shared, mutable state:
cpython/Modules/socketmodule.c
Line 551 in 9f983e0
In the free-threaded build, we should use relaxed atomic operations to access defaulttimeout
to avoid data races. This probably requires adding wrappers for 64-bit relaxed atomic load and stores to https://github.com/python/cpython/blob/main/Include/internal/pycore_pyatomic_ft_wrappers.h. Note that _PyTime_t
is a typedef for int64_t
.
For context, here is a similar change from nogil-3.12
, but note that defaulttimeout
is now part of the module state: