summaryrefslogtreecommitdiff
path: root/storage/perfschema/my_thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/perfschema/my_thread.h')
-rw-r--r--storage/perfschema/my_thread.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/perfschema/my_thread.h b/storage/perfschema/my_thread.h
index 12e01a510ed..b9f3f7775ff 100644
--- a/storage/perfschema/my_thread.h
+++ b/storage/perfschema/my_thread.h
@@ -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 */