29#ifndef MY_THREAD_OS_ID_INCLUDED
30#define MY_THREAD_OS_ID_INCLUDED
36#include <sys/syscall.h>
40#ifdef HAVE_PTHREAD_GETTHREADID_NP
41#include <pthread_np.h>
44#ifdef HAVE_PTHREAD_THREADID_NP
59#ifdef HAVE_PTHREAD_THREADID_NP
67 pthread_threadid_np(
nullptr, &tid64);
77 return syscall(SYS_gettid);
81 return GetCurrentThreadId();
83#ifdef HAVE_PTHREAD_GETTHREADID_NP
85 return pthread_getthreadid_np();
87#ifdef HAVE_INTEGER_PTHREAD_SELF
89 return pthread_self();
Defines to make different thread packages compatible.
unsigned long long my_thread_os_id_t
Definition: my_thread_os_id.h:48
static my_thread_os_id_t my_thread_os_id()
Return the operating system thread id.
Definition: my_thread_os_id.h:58