gh-117657: Fix small issues with instrumentation and TSAN (#118064)

Small TSAN fixups for instrumentation
This commit is contained in:
Dino Viehland 2024-04-30 11:38:05 -07:00 committed by GitHub
parent 1f16b4ce56
commit 4a1cf66c5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 25 additions and 13 deletions

View file

@ -11,6 +11,7 @@
#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_opcode_utils.h" // RESUME_AFTER_YIELD_FROM
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_*
#include "pycore_pyerrors.h" // _PyErr_ClearExcState()
#include "pycore_pystate.h" // _PyThreadState_GET()
@ -329,10 +330,11 @@ gen_close_iter(PyObject *yf)
static inline bool
is_resume(_Py_CODEUNIT *instr)
{
uint8_t code = FT_ATOMIC_LOAD_UINT8_RELAXED(instr->op.code);
return (
instr->op.code == RESUME ||
instr->op.code == RESUME_CHECK ||
instr->op.code == INSTRUMENTED_RESUME
code == RESUME ||
code == RESUME_CHECK ||
code == INSTRUMENTED_RESUME
);
}