File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ PyAPI_FUNC(unsigned long) PyThread_get_thread_ident(void);
4242#if (defined(__APPLE__ ) || defined(__linux__ ) || defined(_WIN32 ) \
4343 || defined(__FreeBSD__ ) || defined(__FreeBSD_kernel__ ) \
4444 || defined(__OpenBSD__ ) || defined(__NetBSD__ ) \
45- || defined(__DragonFly__ ) || defined(_AIX ))
45+ || defined(__DragonFly__ ) || defined(_AIX )) \
46+ || defined(__sun__ )
4647#define PY_HAVE_THREAD_NATIVE_ID
4748PyAPI_FUNC (unsigned long ) PyThread_get_thread_native_id (void );
4849#endif
Original file line number Diff line number Diff line change 3030# include <lwp.h> /* _lwp_self() */
3131#elif defined(__DragonFly__ )
3232# include <sys/lwp.h> /* lwp_gettid() */
33+ #elif defined(__sun__ )
34+ # include <thread.h>
3335#endif
3436
3537/* The POSIX spec requires that use of pthread_attr_setstacksize
@@ -399,6 +401,8 @@ PyThread_get_thread_native_id(void)
399401#elif defined(__DragonFly__ )
400402 lwpid_t native_id ;
401403 native_id = lwp_gettid ();
404+ #elif defined(__sun__ )
405+ unsigned long native_id = (unsigned long )getpid () << 32 | thr_self ();
402406#endif
403407 return (unsigned long ) native_id ;
404408}
You can’t perform that action at this time.
0 commit comments