summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-21 10:44:57 (GMT)
committerGitHub <noreply@github.com>2019-05-21 10:44:57 (GMT)
commitd12e75734d46ecde588c5de65e6d64146911d20c (patch)
treef2faae7d94731b96d70d2a5cb703b3744faffa0c /Python
parent925af1d99b69bf3e229411022ad840c5a0cfdcf8 (diff)
downloadcpython-d12e75734d46ecde588c5de65e6d64146911d20c.zip
cpython-d12e75734d46ecde588c5de65e6d64146911d20c.tar.gz
cpython-d12e75734d46ecde588c5de65e6d64146911d20c.tar.bz2
Revert "bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)" (GH-13458)
This reverts commit 4959c33d2555b89b494c678d99be81a65ee864b0.
Diffstat (limited to 'Python')
-rw-r--r--Python/thread_nt.h16
-rw-r--r--Python/thread_pthread.h27
2 files changed, 0 insertions, 43 deletions
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index d3dc2be..5e00c35 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -143,8 +143,6 @@ LeaveNonRecursiveMutex(PNRMUTEX mutex)
unsigned long PyThread_get_thread_ident(void);
-unsigned long PyThread_get_thread_native_id(void);
-
/*
* Initialization of the C package, should not be needed.
*/
@@ -229,20 +227,6 @@ PyThread_get_thread_ident(void)
return GetCurrentThreadId();
}
-/*
- * Return the native Thread ID (TID) of the calling thread.
- * The native ID of a thread is valid and guaranteed to be unique system-wide
- * from the time the thread is created until the thread has been terminated.
- */
-unsigned long
-PyThread_get_thread_native_id(void)
-{
- if (!initialized)
- PyThread_init_thread();
-
- return GetCurrentThreadId();
-}
-
void _Py_NO_RETURN
PyThread_exit_thread(void)
{
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 87c98d3..4c106d9 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -12,12 +12,6 @@
#endif
#include <signal.h>
-#if defined(__linux__)
-#include <sys/syscall.h>
-#elif defined(__FreeBSD__)
-#include <pthread_np.h>
-#endif
-
/* The POSIX spec requires that use of pthread_attr_setstacksize
be conditional on _POSIX_THREAD_ATTR_STACKSIZE being defined. */
#ifdef _POSIX_THREAD_ATTR_STACKSIZE
@@ -308,27 +302,6 @@ PyThread_get_thread_ident(void)
return (unsigned long) threadid;
}
-unsigned long
-PyThread_get_thread_native_id(void)
-{
- if (!initialized)
- PyThread_init_thread();
-#ifdef __APPLE__
- uint64_t native_id;
- pthread_threadid_np(NULL, &native_id);
-#elif defined(__linux__)
- pid_t native_id;
- native_id = syscall(__NR_gettid);
-#elif defined(__FreeBSD__)
- pid_t native_id;
- native_id = pthread_getthreadid_np();
-#else
- unsigned long native_id;
- native_id = 0;
-#endif
- return (unsigned long) native_id;
-}
-
void _Py_NO_RETURN
PyThread_exit_thread(void)
{