summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorDino Viehland <dinoviehland@meta.com>2024-04-19 21:47:42 (GMT)
committerGitHub <noreply@github.com>2024-04-19 21:47:42 (GMT)
commit07525c9a85e7fa04db565c6e6e6605ff6099dcb7 (patch)
treeb12112a245641172073d1f1df8212aa082ec8db8 /Python/ceval.c
parentb45af00bad3449b85c8f54ba7a9474ca1f52de69 (diff)
downloadcpython-07525c9a85e7fa04db565c6e6e6605ff6099dcb7.zip
cpython-07525c9a85e7fa04db565c6e6e6605ff6099dcb7.tar.gz
cpython-07525c9a85e7fa04db565c6e6e6605ff6099dcb7.tar.bz2
gh-116818: Make `sys.settrace`, `sys.setprofile`, and monitoring thread-safe (#116775)
Makes sys.settrace, sys.setprofile, and monitoring generally thread-safe. Mostly uses a stop-the-world approach and synchronization around the code object's _co_instrumentation_version. There may be a little bit of extra synchronization around the monitoring data that's required to be TSAN clean.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b88e555..2f217c5 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -20,6 +20,7 @@
#include "pycore_opcode_metadata.h" // EXTRA_CASES
#include "pycore_optimizer.h" // _PyUOpExecutor_Type
#include "pycore_opcode_utils.h" // MAKE_FUNCTION_*
+#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_PTR_ACQUIRE
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_range.h" // _PyRangeIterObject