From 9d21fad5396214e64e1e918d8502ab116984b28c Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Fri, 9 Dec 2022 09:34:38 -0700 Subject: [PATCH 1/2] Set _USE_PTHREADS for HAVE_PTHREAD_STUBS. --- Include/internal/pycore_pythread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/internal/pycore_pythread.h b/Include/internal/pycore_pythread.h index 4aeb285b89a848..f53921494c158f 100644 --- a/Include/internal/pycore_pythread.h +++ b/Include/internal/pycore_pythread.h @@ -33,7 +33,7 @@ extern "C" { # endif /* _POSIX_THREADS */ #endif /* _POSIX_THREADS */ -#if defined(_POSIX_THREADS) && !defined(HAVE_PTHREAD_STUBS) +#if defined(_POSIX_THREADS) || defined(HAVE_PTHREAD_STUBS) # define _USE_PTHREADS #endif From 626a35c445eee3b5b484cb124d81e677f1bf6fc7 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Fri, 9 Dec 2022 09:34:51 -0700 Subject: [PATCH 2/2] Clarify an endif. --- Python/thread_pthread.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index ae312e987bd6ad..76d6f3bcdf9c40 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -132,7 +132,8 @@ init_condattr(void) if (pthread_condattr_setclock(&ca, CLOCK_MONOTONIC) == 0) { condattr_monotonic = &ca; // Use monotonic clock } -#endif +# undef ca +#endif // CONDATTR_MONOTONIC } int