Skip to content

Commit

Permalink
Add openmp __kmp_gettid() wrapper, using pthread_getthreadid_np(3).
Browse files Browse the repository at this point in the history
This has also been submitted upstream.

PR:           236062
MFC after:    1 month
X-MFC-With:   r344779
  • Loading branch information
DimitryAndric committed Mar 16, 2019
1 parent efddb4e commit 4ccae81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/openmp/runtime/src/kmp_wrapper_getpid.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#if KMP_OS_DARWIN
// OS X
#define __kmp_gettid() syscall(SYS_thread_selfid)
#elif KMP_OS_FREEBSD
#include <pthread_np.h>
#define __kmp_gettid() pthread_getthreadid_np()
#elif KMP_OS_NETBSD
#include <lwp.h>
#define __kmp_gettid() _lwp_self()
Expand Down

0 comments on commit 4ccae81

Please sign in to comment.