gh-117657: Avoid sem_clockwait in TSAN (#119915)

The `sem_clockwait` function is not currently instrumented, which leads
to false positives.
This commit is contained in:
Sam Gross 2024-06-03 13:42:27 -04:00 committed by GitHub
parent 2e0aa731ae
commit 41c1cefbae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 10 deletions

View file

@ -119,7 +119,7 @@ _PySemaphore_PlatformWait(_PySemaphore *sema, PyTime_t timeout)
if (timeout >= 0) {
struct timespec ts;
#if defined(CLOCK_MONOTONIC) && defined(HAVE_SEM_CLOCKWAIT)
#if defined(CLOCK_MONOTONIC) && defined(HAVE_SEM_CLOCKWAIT) && !defined(_Py_THREAD_SANITIZER)
PyTime_t now;
// silently ignore error: cannot report error to the caller
(void)PyTime_MonotonicRaw(&now);