[PATCH 12/18] Removed nxt_always_inline from (NXT_AIX) nxt_thread_get_tid().

Alejandro Colomar alx.manpages at gmail.com
Thu Jun 2 18:05:06 UTC 2022


It is a huge definition, and it's mostly used in slow paths.

Since we're changing from an nxt_always_inline to a C99 inline
function, we now need to emit an extern function, which will be
used when the function is not inlined.
---
 auto/sources        | 1 +
 src/nxt_thread_id.c | 5 +++++
 src/nxt_thread_id.h | 1 -
 3 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 src/nxt_thread_id.c

diff --git a/auto/sources b/auto/sources
index 27a45ed..dd0c90d 100644
--- a/auto/sources
+++ b/auto/sources
@@ -49,6 +49,7 @@ NXT_LIB_SRCS=" \
     src/nxt_thread.c \
     src/nxt_thread_mutex.c \
     src/nxt_thread_cond.c \
+    src/nxt_thread_id.c \
     src/nxt_spinlock.c \
     src/nxt_semaphore.c \
     src/nxt_thread_pool.c \
diff --git a/src/nxt_thread_id.c b/src/nxt_thread_id.c
new file mode 100644
index 00000000..913d816
--- /dev/null
+++ b/src/nxt_thread_id.c
@@ -0,0 +1,5 @@
+
+#include <nxt_main.h>
+
+
+extern nxt_tid_t nxt_thread_get_tid(void);
diff --git a/src/nxt_thread_id.h b/src/nxt_thread_id.h
index 5f70987..f1922c8 100644
--- a/src/nxt_thread_id.h
+++ b/src/nxt_thread_id.h
@@ -109,7 +109,6 @@ nxt_thread_get_tid(void)
 
 typedef tid_t  nxt_tid_t;
 
-nxt_always_inline
 inline nxt_tid_t
 nxt_thread_get_tid(void)
 {
-- 
2.36.1



More information about the unit mailing list