From 24eb6e59c4c172fe74031590c59401b93f76647b Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Tue, 5 Jan 2021 23:52:10 -0600 Subject: [PATCH 1/2] Add Missing Export to ACE_OS::thr_gettid --- ACE/ace/OS_NS_Thread.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ACE/ace/OS_NS_Thread.h b/ACE/ace/OS_NS_Thread.h index e01e8a2b4f787..313c05317dfdc 100644 --- a/ACE/ace/OS_NS_Thread.h +++ b/ACE/ace/OS_NS_Thread.h @@ -1767,6 +1767,7 @@ namespace ACE_OS { * For older Linux (pre 2.4.11) and other systems that don't have gettid(), * this uses ACE_NOTSUP_RETURN (-1). */ + ACE_Export pid_t thr_gettid (); /** From 8c07da5c4316895917a33dbaed2171ed7ad00448 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 7 Jan 2021 09:32:19 +0100 Subject: [PATCH 2/2] Move thr_gettid to inline * ACE/ace/OS_NS_Thread.cpp: * ACE/ace/OS_NS_Thread.h: * ACE/ace/OS_NS_Thread.inl: --- ACE/ace/OS_NS_Thread.cpp | 10 ---------- ACE/ace/OS_NS_Thread.h | 2 +- ACE/ace/OS_NS_Thread.inl | 10 ++++++++++ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ACE/ace/OS_NS_Thread.cpp b/ACE/ace/OS_NS_Thread.cpp index 4c94dd1312055..93b431881c5da 100644 --- a/ACE/ace/OS_NS_Thread.cpp +++ b/ACE/ace/OS_NS_Thread.cpp @@ -4840,16 +4840,6 @@ ACE_OS::unique_name (const void *object, } #endif -pid_t -ACE_OS::thr_gettid () -{ -#ifdef ACE_HAS_GETTID - return syscall (SYS_gettid); -#else - ACE_NOTSUP_RETURN (-1); -#endif -} - ACE_END_VERSIONED_NAMESPACE_DECL #if defined (ACE_VXWORKS) && !defined (__RTP__) diff --git a/ACE/ace/OS_NS_Thread.h b/ACE/ace/OS_NS_Thread.h index 313c05317dfdc..9419f1d0812c5 100644 --- a/ACE/ace/OS_NS_Thread.h +++ b/ACE/ace/OS_NS_Thread.h @@ -1767,7 +1767,7 @@ namespace ACE_OS { * For older Linux (pre 2.4.11) and other systems that don't have gettid(), * this uses ACE_NOTSUP_RETURN (-1). */ - ACE_Export + ACE_NAMESPACE_INLINE_FUNCTION pid_t thr_gettid (); /** diff --git a/ACE/ace/OS_NS_Thread.inl b/ACE/ace/OS_NS_Thread.inl index 4b34fdeea1186..7ab6d5894f131 100644 --- a/ACE/ace/OS_NS_Thread.inl +++ b/ACE/ace/OS_NS_Thread.inl @@ -3179,6 +3179,16 @@ ACE_OS::thr_gettid (char buffer[], size_t buffer_length) static_cast (ACE_OS::thr_gettid ())); } +ACE_INLINE pid_t +ACE_OS::thr_gettid () +{ +#ifdef ACE_HAS_GETTID + return syscall (SYS_gettid); +#else + ACE_NOTSUP_RETURN (-1); +#endif +} + ACE_INLINE ACE_thread_t ACE_OS::thr_self () {