SIGN IN SIGN UP

gh-129701: Fix a data race in `intern_common` in the free threaded build (GH-130089)

* gh-129701: Fix a data race in `intern_common` in the free threaded build

* Use a mutex to avoid potentially returning a non-immortalized string,
  because immortalization happens after the insertion into the interned
  dict.

* Use `Py_DECREF()` calls instead of `Py_SET_REFCNT(s, Py_REFCNT(s) - 2)`
  for thread-safety. This code path isn't performance sensistive, so
  just use `Py_DECREF()` unconditionally for simplicity.
S
Sam Gross committed
b9d2ee687cfca6365e26e156b1e22824b16dabb8
Parent: fc8c99a
Committed by GitHub <noreply@github.com> on 2/17/2025, 1:15:40 PM