1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-23091: perfschema Add support for OpenBSD's getthrid() to retrieve the thread id

This commit is contained in:
Brad Smith
2020-08-07 00:00:40 -04:00
committed by Daniel Black
parent fe5dbfe723
commit 482cf29e16
3 changed files with 16 additions and 0 deletions

View File

@@ -67,6 +67,10 @@ static inline my_thread_os_id_t my_thread_os_id()
/* FreeBSD 10.2 */
return pthread_getthreadid_np();
#else
#ifdef HAVE_GETTHRID
/* OpenBSD */
return getthrid();
#else
#ifdef HAVE_INTEGER_PTHREAD_SELF
/* Unknown platform, fallback. */
return pthread_self();
@@ -74,6 +78,7 @@ static inline my_thread_os_id_t my_thread_os_id()
/* Feature not available. */
return 0;
#endif /* HAVE_INTEGER_PTHREAD_SELF */
#endif /* HAVE_GETTHRID */
#endif /* HAVE_PTHREAD_GETTHREADID_NP */
#endif /* _WIN32 */
#endif /* HAVE_SYS_GETTID */