Annotation of pkgsrc/lang/python39/patches/patch-Python_thread__pthread.h, revision 1.2
1.2 ! nia 1: $NetBSD: patch-Python_thread__pthread.h,v 1.1 2020/10/10 20:20:12 adam Exp $
1.1 adam 2:
1.2 ! nia 3: https://bugs.python.org/issue46045
! 4: https://trac.macports.org/ticket/59772
! 5:
! 6: --- Python/thread_pthread.h.orig 2023-08-24 17:59:28.000000000 +0000
1.1 adam 7: +++ Python/thread_pthread.h
1.2 ! nia 8: @@ -78,6 +78,9 @@
1.1 adam 9: we need to add 0 to make it work there as well. */
10: #if (_POSIX_SEMAPHORES+0) == -1
11: #define HAVE_BROKEN_POSIX_SEMAPHORES
12: +#elif defined(__NetBSD__)
13: +/* XXX accesses to closed file descriptors, needs debugging */
14: +#define HAVE_BROKEN_POSIX_SEMAPHORES
15: #else
16: #include <semaphore.h>
17: #include <errno.h>
1.2 ! nia 18: @@ -340,7 +343,17 @@ PyThread_get_thread_native_id(void)
! 19: PyThread_init_thread();
! 20: #ifdef __APPLE__
! 21: uint64_t native_id;
! 22: +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
! 23: + native_id = pthread_mach_thread_np(pthread_self());
! 24: +#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060
! 25: + if (&pthread_threadid_np != NULL) {
! 26: + (void) pthread_threadid_np(NULL, &native_id);
! 27: + } else {
! 28: + native_id = pthread_mach_thread_np(pthread_self());
! 29: + }
! 30: +#else
! 31: (void) pthread_threadid_np(NULL, &native_id);
! 32: +#endif
! 33: #elif defined(__linux__)
! 34: pid_t native_id;
! 35: native_id = syscall(SYS_gettid);
CVSweb <webmaster@jp.NetBSD.org>