8000 bpo-42047: DragonFlyBSD thread native id support. by devnexen · Pull Request #22714 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42047: DragonFlyBSD thread native id support. #22714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Include/pythread.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PyAPI_FUNC(unsigned long) PyThread_start_new_thread(void (*)(void *), void *);
PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void);
PyAPI_FUNC(unsigned long) PyThread_get_thread_ident(void);

#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(_WIN32) || defined(_AIX)
#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(_WIN32) || defined(_AIX)
#define PY_HAVE_THREAD_NATIVE_ID
PyAPI_FUNC(unsigned long) PyThread_get_thread_native_id(void);
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added thread native id support for DragonflyBSD.
5 changes: 5 additions & 0 deletions Python/thread_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
0