From 8b2a533c71ed47d364cb3456067d3341300c46e8 Mon Sep 17 00:00:00 2001 From: Nick Chomey <88559987+nickchomey@users.noreply.github.com> Date: Tue, 13 Oct 2026 17:53:52 -0600 Subject: [PATCH 1/3] Expose frankenphp_thread_index() to C extensions (declare in frankenphp.h, drop static inline) --- frankenphp.c | 2 +- frankenphp.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frankenphp.c b/frankenphp.c index ea72e5ecca..6eaa9106af 100644 --- a/frankenphp.c +++ b/frankenphp.c @@ -141,7 +141,7 @@ typedef struct { } frankenphp_server_ctx; static THREAD_LOCAL frankenphp_server_ctx frankenphp_local_server_ctx; -static inline uintptr_t frankenphp_thread_index(void) { +uintptr_t frankenphp_thread_index(void) { frankenphp_server_ctx *ctx = (frankenphp_server_ctx *)SG(server_context); /* Fall back to the OS thread's own TLS before * frankenphp_update_request_context(). */ diff --git a/frankenphp.h b/frankenphp.h index fe38b13c76..0696db08ca 100644 --- a/frankenphp.h +++ b/frankenphp.h @@ -221,4 +221,6 @@ typedef enum { void register_extensions(zend_module_entry **m, int len); +uintptr_t frankenphp_thread_index(void); + #endif From d6efd80463f5e0d5ac64018aa9893a8d03496adc Mon Sep 17 00:00:00 2001 From: nickchomey <88559987+nickchomey@users.noreply.github.com> Date: Thu, 15 Oct 2026 12:42:05 -0600 Subject: [PATCH 2/3] add comment to say the export is for extensions' use Signed-off-by: nickchomey <88559987+nickchomey@users.noreply.github.com> --- frankenphp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/frankenphp.h b/frankenphp.h index 0696db08ca..97d844ca94 100644 --- a/frankenphp.h +++ b/frankenphp.h @@ -221,6 +221,7 @@ typedef enum { void register_extensions(zend_module_entry **m, int len); +// This function is exported for use by extensions, as proposed in PR #2305 uintptr_t frankenphp_thread_index(void); #endif From dc0047e19e3e8f7f0903f0f86c2967f327d76d9e Mon Sep 17 00:00:00 2001 From: Nick Chomey <88559987+nickchomey@users.noreply.github.com> Date: Thu, 15 Oct 2026 16:19:51 -0600 Subject: [PATCH 3/3] remove trailing space with clang-format --- frankenphp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frankenphp.h b/frankenphp.h index 97d844ca94..5eb6316947 100644 --- a/frankenphp.h +++ b/frankenphp.h @@ -221,7 +221,7 @@ typedef enum { void register_extensions(zend_module_entry **m, int len); -// This function is exported for use by extensions, as proposed in PR #2305 +// This function is exported for use by extensions, as proposed in PR #2305 uintptr_t frankenphp_thread_index(void); #endif