summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorDino Viehland <dinoviehland@meta.com>2024-04-30 18:38:05 (GMT)
committerGitHub <noreply@github.com>2024-04-30 18:38:05 (GMT)
commit4a1cf66c5c0afa36d7a51d5f9d3874cda10df79c (patch)
tree3a37a8d9e9758ba71ad558a051324c20e140c777 /Objects
parent1f16b4ce569f222af74fcbb7b2ef98eee2398d20 (diff)
downloadcpython-4a1cf66c5c0afa36d7a51d5f9d3874cda10df79c.zip
cpython-4a1cf66c5c0afa36d7a51d5f9d3874cda10df79c.tar.gz
cpython-4a1cf66c5c0afa36d7a51d5f9d3874cda10df79c.tar.bz2
gh-117657: Fix small issues with instrumentation and TSAN (#118064)
Small TSAN fixups for instrumentation
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genobject.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 04736a0..a1ed1cb 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -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
);
}