*value_addr = value;
if (value != NULL) {
assert(ix >= 0);
- Py_INCREF(value);
+ _Py_NewRefWithLock(value);
}
Py_END_CRITICAL_SECTION();
return ix;
// Still no dict, we can read from the values
assert(values->valid);
value = values->values[ix];
- *attr = Py_XNewRef(value);
+ *attr = _Py_XNewRefWithLock(value);
success = true;
}
if (dict->ma_values == values && FT_ATOMIC_LOAD_UINT8(values->valid)) {
value = _Py_atomic_load_ptr_relaxed(&values->values[ix]);
- *attr = Py_XNewRef(value);
+ *attr = _Py_XNewRefWithLock(value);
success = true;
} else {
// Caller needs to lookup from the dictionary