mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-42047: Add native thread ID for DragonFlyBSD (#22714)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
e0477ae371
commit
9a1adf2790
5 changed files with 11 additions and 3 deletions
|
@ -23,6 +23,8 @@
|
|||
# include <sys/thread.h> /* thread_self() */
|
||||
#elif defined(__NetBSD__)
|
||||
# include <lwp.h> /* _lwp_self() */
|
||||
#elif defined(__DragonFly__)
|
||||
# include <sys/lwp.h> /* lwp_gettid() */
|
||||
#endif
|
||||
|
||||
/* The POSIX spec requires that use of pthread_attr_setstacksize
|
||||
|
@ -349,6 +351,9 @@ PyThread_get_thread_native_id(void)
|
|||
#elif defined(__NetBSD__)
|
||||
lwpid_t native_id;
|
||||
native_id = _lwp_self();
|
||||
#elif defined(__DragonFly__)
|
||||
lwpid_t native_id;
|
||||
native_id = lwp_gettid();
|
||||
#endif
|
||||
return (unsigned long) native_id;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue