interp = interpreters.create()
alive.append(interp)
- @unittest.skip('(temporary) gh-120524: there is a race that needs fixing')
@support.requires_resource('cpu')
def test_create_many_threaded(self):
alive = []
assert((initial == 1) ==
(_PyRuntime.types.managed_static.types[full_index].interp_count == 0));
- _PyRuntime.types.managed_static.types[full_index].interp_count += 1;
+ (void)_Py_atomic_add_int64(
+ &_PyRuntime.types.managed_static.types[full_index].interp_count, 1);
if (initial) {
assert(_PyRuntime.types.managed_static.types[full_index].type == NULL);
state->type = NULL;
assert(state->tp_weaklist == NULL); // It was already cleared out.
- _PyRuntime.types.managed_static.types[full_index].interp_count -= 1;
+ (void)_Py_atomic_add_int64(
+ &_PyRuntime.types.managed_static.types[full_index].interp_count, -1);
if (final) {
assert(!_PyRuntime.types.managed_static.types[full_index].interp_count);
_PyRuntime.types.managed_static.types[full_index].type = NULL;