Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
482cf29e
Commit
482cf29e
authored
Aug 07, 2020
by
Brad Smith
Committed by
Daniel Black
Aug 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-23091: perfschema Add support for OpenBSD's getthrid() to retrieve the thread id
parent
fe5dbfe7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
storage/perfschema/CMakeLists.txt
storage/perfschema/CMakeLists.txt
+10
-0
storage/perfschema/my_thread.h
storage/perfschema/my_thread.h
+5
-0
storage/perfschema/pfs_config.h.cmake
storage/perfschema/pfs_config.h.cmake
+1
-0
No files found.
storage/perfschema/CMakeLists.txt
View file @
482cf29e
...
...
@@ -298,6 +298,16 @@ int main(int ac, char **av)
}"
HAVE_SYS_GETTID
)
# Check for getthrid()
CHECK_C_SOURCE_COMPILES
(
"
#include <unistd.h>
int main(int ac, char **av)
{
unsigned long long tid = getthrid();
return (tid != 0 ? 0 : 1);
}"
HAVE_GETTHRID
)
# Check for pthread_getthreadid_np()
CHECK_C_SOURCE_COMPILES
(
"
#include <pthread_np.h>
...
...
storage/perfschema/my_thread.h
View file @
482cf29e
...
...
@@ -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 */
...
...
storage/perfschema/pfs_config.h.cmake
View file @
482cf29e
#cmakedefine HAVE_PTHREAD_THREADID_NP 1
#cmakedefine HAVE_SYS_GETTID 1
#cmakedefine HAVE_GETTHRID 1
#cmakedefine HAVE_PTHREAD_GETTHREADID_NP 1
#cmakedefine HAVE_INTEGER_PTHREAD_SELF 1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment