summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-07-30 17:53:47 (GMT)
committerGitHub <noreply@github.com>2024-07-30 17:53:47 (GMT)
commit2b163aa9e796b312bb0549d49145d26e4904768e (patch)
treecbfe5e55783686a86b432e1955eb223e5f8b85b8 /Python
parent1d8e45390733d3eb29164799ea10f8406f53e830 (diff)
downloadcpython-2b163aa9e796b312bb0549d49145d26e4904768e.zip
cpython-2b163aa9e796b312bb0549d49145d26e4904768e.tar.gz
cpython-2b163aa9e796b312bb0549d49145d26e4904768e.tar.bz2
gh-117657: Avoid race in `PAUSE_ADAPTIVE_COUNTER` in free-threaded build (#122190)
The adaptive counter doesn't do anything currently in the free-threaded build and TSan reports a data race due to concurrent modifications to the counter.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval_macros.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h
index 60efe3d..2881ed2 100644
--- a/Python/ceval_macros.h
+++ b/Python/ceval_macros.h
@@ -316,17 +316,18 @@ GETITEM(PyObject *v, Py_ssize_t i) {
/* gh-115999 tracks progress on addressing this. */ \
static_assert(0, "The specializing interpreter is not yet thread-safe"); \
} while (0);
+#define PAUSE_ADAPTIVE_COUNTER(COUNTER) ((void)COUNTER)
#else
#define ADVANCE_ADAPTIVE_COUNTER(COUNTER) \
do { \
(COUNTER) = advance_backoff_counter((COUNTER)); \
} while (0);
-#endif
#define PAUSE_ADAPTIVE_COUNTER(COUNTER) \
do { \
(COUNTER) = pause_backoff_counter((COUNTER)); \
} while (0);
+#endif
#define UNBOUNDLOCAL_ERROR_MSG \
"cannot access local variable '%s' where it is not associated with a value"