From 77d81aa4a3747b7dfbb17e43b16e1a514550c60c Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 1 Dec 2019 20:18:01 +0300 Subject: Import python3.8 (3.8.0-5) --- debian/patches/hurd_kfreebsd_thread_native_id.diff | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 debian/patches/hurd_kfreebsd_thread_native_id.diff (limited to 'debian/patches/hurd_kfreebsd_thread_native_id.diff') diff --git a/debian/patches/hurd_kfreebsd_thread_native_id.diff b/debian/patches/hurd_kfreebsd_thread_native_id.diff new file mode 100644 index 0000000..1b02cf7 --- /dev/null +++ b/debian/patches/hurd_kfreebsd_thread_native_id.diff @@ -0,0 +1,34 @@ +--- a/Include/pythread.h ++++ b/Include/pythread.h +@@ -26,7 +26,7 @@ PyAPI_FUNC(unsigned long) PyThread_start + PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void); + PyAPI_FUNC(unsigned long) PyThread_get_thread_ident(void); + +-#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(_WIN32) || defined(_AIX) ++#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(_WIN32) || defined(_AIX) || defined(__GNU__) + #define PY_HAVE_THREAD_NATIVE_ID + PyAPI_FUNC(unsigned long) PyThread_get_thread_native_id(void); + #endif +--- a/Python/thread_pthread.h ++++ b/Python/thread_pthread.h +@@ -22,6 +22,9 @@ + # include /* thread_self() */ + #elif defined(__NetBSD__) + # include /* _lwp_self() */ ++#elif defined(__GNU__) || defined(__FreeBSD_kernel__) ++# include /* mach_thread_self(), mach_task_self(), ++ mach_port_deallocate() */ + #endif + + /* The POSIX spec requires that use of pthread_attr_setstacksize +@@ -343,6 +346,10 @@ PyThread_get_thread_native_id(void) + #elif defined(__NetBSD__) + lwpid_t native_id; + native_id = _lwp_self(); ++#elif defined(__GNU__) || defined(__FreeBSD_kernel__) ++ mach_port_t native_id; ++ native_id = mach_thread_self(); ++ mach_port_deallocate(mach_task_self(), mach_thread_self()); + #endif + return (unsigned long) native_id; + } -- cgit v1.2.3