mirror of
https://github.com/python/cpython.git
synced 2025-10-24 18:33:49 +00:00
gh-137884: Added threading.get_native_id() on Illumos/Solaris (GH-137927)
This commit is contained in:
parent
3143ceeb1d
commit
7dc42b67a7
5 changed files with 16 additions and 3 deletions
|
|
@ -30,6 +30,8 @@
|
|||
# include <lwp.h> /* _lwp_self() */
|
||||
#elif defined(__DragonFly__)
|
||||
# include <sys/lwp.h> /* lwp_gettid() */
|
||||
#elif defined(__sun__) && SIZEOF_LONG >= 8
|
||||
# include <thread.h>
|
||||
#endif
|
||||
|
||||
/* The POSIX spec requires that use of pthread_attr_setstacksize
|
||||
|
|
@ -399,6 +401,8 @@ PyThread_get_thread_native_id(void)
|
|||
#elif defined(__DragonFly__)
|
||||
lwpid_t native_id;
|
||||
native_id = lwp_gettid();
|
||||
#elif defined(__sun__) && SIZEOF_LONG >= 8
|
||||
unsigned long native_id = (unsigned long)getpid() << 32 | thr_self();
|
||||
#endif
|
||||
return (unsigned long) native_id;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue