mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
Revert "bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)" (GH-13458)
This reverts commit 4959c33d25
.
This commit is contained in:
parent
925af1d99b
commit
d12e75734d
10 changed files with 2 additions and 133 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue