perfschema: native type for my_thread_os_id_t
Though these will all get case to unsigned long long where it is populated into the perfschema's BIGINT type. Use uintptr_t for NetBSD per Nia Alarie's original #1836.
This commit is contained in:
parent
90adf2aa59
commit
0d44792a83
@ -17,7 +17,17 @@
|
|||||||
typedef pthread_key_t thread_local_key_t;
|
typedef pthread_key_t thread_local_key_t;
|
||||||
typedef pthread_t my_thread_handle;
|
typedef pthread_t my_thread_handle;
|
||||||
typedef pthread_attr_t my_thread_attr_t;
|
typedef pthread_attr_t my_thread_attr_t;
|
||||||
|
#if defined(HAVE_PTHREAD_THREADID_NP) || defined(HAVE_GETTID) || defined(HAVE_SYS_GETTID) || defined(HAVE_GETTHRID)
|
||||||
|
typedef pid_t my_thread_os_id_t;
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
typedef uint32 my_thread_os_id_t;
|
||||||
|
#elif defined(HAVE_PTHREAD_GETTHREADID_NP)
|
||||||
|
typedef int my_thread_os_id_t;
|
||||||
|
#elif defined(HAVE_INTEGER_PTHREAD_SELF)
|
||||||
|
typedef uintptr_t my_thread_os_id_t;
|
||||||
|
#else
|
||||||
typedef unsigned long long my_thread_os_id_t;
|
typedef unsigned long long my_thread_os_id_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LOCK_plugin_delete LOCK_plugin
|
#define LOCK_plugin_delete LOCK_plugin
|
||||||
|
|
||||||
@ -74,8 +84,8 @@ static inline my_thread_os_id_t my_thread_os_id()
|
|||||||
return getthrid();
|
return getthrid();
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_INTEGER_PTHREAD_SELF
|
#ifdef HAVE_INTEGER_PTHREAD_SELF
|
||||||
/* Unknown platform, fallback. */
|
/* NetBSD, and perhaps something else, fallback. */
|
||||||
return (unsigned long long)pthread_self();
|
return (my_thread_os_id_t) pthread_self();
|
||||||
#else
|
#else
|
||||||
/* Feature not available. */
|
/* Feature not available. */
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user