| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,6 @@ def test_create_many_sequential(self): | |||
| 22 | 22 | interp = interpreters.create() | |
| 23 | 23 | alive.append(interp) | |
| 24 | 24 | ||
| 25 | - @unittest.skip('(temporary) gh-120524: there is a race that needs fixing') | ||
| 26 | 25 | @support.requires_resource('cpu') | |
| 27 | 26 | def test_create_many_threaded(self): | |
| 28 | 27 | alive = [] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -246,7 +246,8 @@ managed_static_type_state_init(PyInterpreterState *interp, PyTypeObject *self, | |||
| 246 | 246 | ||
| 247 | 247 | assert((initial == 1) == | |
| 248 | 248 | (_PyRuntime.types.managed_static.types[full_index].interp_count == 0)); | |
| 249 | - _PyRuntime.types.managed_static.types[full_index].interp_count += 1; | ||
| 249 | + (void)_Py_atomic_add_int64( | ||
| 250 | + &_PyRuntime.types.managed_static.types[full_index].interp_count, 1); | ||
| 250 | 251 | ||
| 251 | 252 | if (initial) { | |
| 252 | 253 | assert(_PyRuntime.types.managed_static.types[full_index].type == NULL); | |
@@ -300,7 +301,8 @@ managed_static_type_state_clear(PyInterpreterState *interp, PyTypeObject *self, | |||
| 300 | 301 | state->type = NULL; | |
| 301 | 302 | assert(state->tp_weaklist == NULL); // It was already cleared out. | |
| 302 | 303 | ||
| 303 | - _PyRuntime.types.managed_static.types[full_index].interp_count -= 1; | ||
| 304 | + (void)_Py_atomic_add_int64( | ||
| 305 | + &_PyRuntime.types.managed_static.types[full_index].interp_count, -1); | ||
| 304 | 306 | if (final) { | |
| 305 | 307 | assert(!_PyRuntime.types.managed_static.types[full_index].interp_count); | |
| 306 | 308 | _PyRuntime.types.managed_static.types[full_index].type = NULL; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments