Commit b9d2ee6
authored
* 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.
1 parent fc8c99a commit b9d2ee6
File tree
2 files changed
+17
-6
lines changed- Include/internal
- Objects
2 files changed
+17
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
| |||
15814 | 15822 | | |
15815 | 15823 | | |
15816 | 15824 | | |
| 15825 | + | |
15817 | 15826 | | |
15818 | 15827 | | |
15819 | 15828 | | |
15820 | 15829 | | |
15821 | 15830 | | |
| 15831 | + | |
15822 | 15832 | | |
15823 | 15833 | | |
15824 | 15834 | | |
| |||
15828 | 15838 | | |
15829 | 15839 | | |
15830 | 15840 | | |
| 15841 | + | |
15831 | 15842 | | |
15832 | 15843 | | |
15833 | 15844 | | |
| |||
15844 | 15855 | | |
15845 | 15856 | | |
15846 | 15857 | | |
15847 | | - | |
15848 | | - | |
15849 | | - | |
15850 | | - | |
15851 | | - | |
15852 | | - | |
| 15858 | + | |
| 15859 | + | |
15853 | 15860 | | |
15854 | 15861 | | |
15855 | 15862 | | |
| |||
15864 | 15871 | | |
15865 | 15872 | | |
15866 | 15873 | | |
| 15874 | + | |
15867 | 15875 | | |
15868 | 15876 | | |
15869 | 15877 | | |
| |||
0 commit comments