mirror of
https://github.com/python/cpython.git
synced 2026-01-26 12:55:08 +00:00
gh-120321: Fix TSan reported race in gen_clear_frame (gh-142995)
TSan treats compare-exchanges that fail as if they are writes so there is a false positive with the read of gi_frame_state in gen_close.
This commit is contained in:
parent
08bc03ff2a
commit
4ea3c1a047
@ -153,7 +153,7 @@ _PyGen_Finalize(PyObject *self)
|
||||
static void
|
||||
gen_clear_frame(PyGenObject *gen)
|
||||
{
|
||||
assert(gen->gi_frame_state == FRAME_CLEARED);
|
||||
assert(FT_ATOMIC_LOAD_INT8_RELAXED(gen->gi_frame_state) == FRAME_CLEARED);
|
||||
_PyInterpreterFrame *frame = &gen->gi_iframe;
|
||||
frame->previous = NULL;
|
||||
_PyFrame_ClearExceptCode(frame);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user