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..5eb6316947 100644 --- a/frankenphp.h +++ b/frankenphp.h @@ -221,4 +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