mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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.
This commit is contained in:
parent
1d8e453907
commit
2b163aa9e7
2 changed files with 2 additions and 2 deletions
|
@ -316,17 +316,18 @@ GETITEM(PyObject *v, Py_ssize_t i) {
|
||||||
/* gh-115999 tracks progress on addressing this. */ \
|
/* gh-115999 tracks progress on addressing this. */ \
|
||||||
static_assert(0, "The specializing interpreter is not yet thread-safe"); \
|
static_assert(0, "The specializing interpreter is not yet thread-safe"); \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
#define PAUSE_ADAPTIVE_COUNTER(COUNTER) ((void)COUNTER)
|
||||||
#else
|
#else
|
||||||
#define ADVANCE_ADAPTIVE_COUNTER(COUNTER) \
|
#define ADVANCE_ADAPTIVE_COUNTER(COUNTER) \
|
||||||
do { \
|
do { \
|
||||||
(COUNTER) = advance_backoff_counter((COUNTER)); \
|
(COUNTER) = advance_backoff_counter((COUNTER)); \
|
||||||
} while (0);
|
} while (0);
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PAUSE_ADAPTIVE_COUNTER(COUNTER) \
|
#define PAUSE_ADAPTIVE_COUNTER(COUNTER) \
|
||||||
do { \
|
do { \
|
||||||
(COUNTER) = pause_backoff_counter((COUNTER)); \
|
(COUNTER) = pause_backoff_counter((COUNTER)); \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define UNBOUNDLOCAL_ERROR_MSG \
|
#define UNBOUNDLOCAL_ERROR_MSG \
|
||||||
"cannot access local variable '%s' where it is not associated with a value"
|
"cannot access local variable '%s' where it is not associated with a value"
|
||||||
|
|
|
@ -23,7 +23,6 @@ race:free_threadstate
|
||||||
|
|
||||||
# These warnings trigger directly in a CPython function.
|
# These warnings trigger directly in a CPython function.
|
||||||
|
|
||||||
race_top:_PyEval_EvalFrameDefault
|
|
||||||
race_top:assign_version_tag
|
race_top:assign_version_tag
|
||||||
race_top:new_reference
|
race_top:new_reference
|
||||||
race_top:_multiprocessing_SemLock_acquire_impl
|
race_top:_multiprocessing_SemLock_acquire_impl
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue