diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2023-02-10 18:52:27 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-15 21:58:01 +0000 |
commit | 0bcab58551bfe0682f7dbebe759874b49b2c5019 (patch) | |
tree | 23432ce32f72e73ab7ff960072415f4de5dc4862 | |
parent | 4213cf5b6c7353a7194383f4ad70f55dd84aa852 (diff) | |
download | mongo-0bcab58551bfe0682f7dbebe759874b49b2c5019.tar.gz |
SERVER-73905 Implement getCurrentNativeThreadId for FreeBSD
(cherry picked from commit 7165ae9350e3e9bd9b77a74cf3a36b5a038de6fa)
-rw-r--r-- | src/mongo/platform/process_id.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/platform/process_id.cpp b/src/mongo/platform/process_id.cpp index cff6af7e2db..eff158ca41e 100644 --- a/src/mongo/platform/process_id.cpp +++ b/src/mongo/platform/process_id.cpp @@ -40,6 +40,10 @@ #include <sys/types.h> #endif +#ifdef __FreeBSD__ +#include <pthread_np.h> +#endif + #include <iostream> #include <limits> #include <sstream> @@ -73,6 +77,10 @@ inline NativeProcessId getCurrentNativeThreadId() { invariant(::pthread_threadid_np(NULL, &tid) == 0); return tid; } +#elif __FreeBSD__ +inline NativeProcessId getCurrentNativeThreadId() { + return pthread_getthreadid_np(); +} #else inline NativeProcessId getCurrentNativeThreadId() { return ::syscall(SYS_gettid); |