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:
David CARLIER 2022-05-18 14:10:10 +01:00 committed by GitHub
parent e0477ae371
commit 9a1adf2790
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 3 deletions

View file

@ -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;
}