From 4907d14700eba701c2abc6a01cc340001385a5eb Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Wed, 8 Jul 2015 20:38:30 +0800 Subject: [PATCH] fixed a compilation error when both the dtrace static probes and --with-threads are specified. --- patches/nginx-1.9.2-dtrace.patch | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/patches/nginx-1.9.2-dtrace.patch b/patches/nginx-1.9.2-dtrace.patch index b2ff187..11cea6b 100644 --- a/patches/nginx-1.9.2-dtrace.patch +++ b/patches/nginx-1.9.2-dtrace.patch @@ -451,6 +451,21 @@ index ef4a647..49bb30b 100644 return p; } +diff --git a/src/core/ngx_thread_pool.h b/src/core/ngx_thread_pool.h +index 5e5adf6..5999525 100644 +--- a/src/core/ngx_thread_pool.h ++++ b/src/core/ngx_thread_pool.h +@@ -23,7 +23,10 @@ struct ngx_thread_task_s { + }; + + ++#ifndef NGX_DEFINE_THREAD_POOL_T ++#define NGX_DEFINE_THREAD_POOL_T 1 + typedef struct ngx_thread_pool_s ngx_thread_pool_t; ++#endif + + + ngx_thread_pool_t *ngx_thread_pool_add(ngx_conf_t *cf, ngx_str_t *name); diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp new file mode 100644 index 0000000..e824daf @@ -816,10 +831,10 @@ index 0000000..1bca4cf + diff --git a/src/event/ngx_event_probe.h b/src/event/ngx_event_probe.h new file mode 100644 -index 0000000..5aa0397 +index 0000000..9fa2a82 --- /dev/null +++ b/src/event/ngx_event_probe.h -@@ -0,0 +1,33 @@ +@@ -0,0 +1,40 @@ +#ifndef _NGX_EVENT_PROBE_H_INCLUDED_ +#define _NGX_EVENT_PROBE_H_INCLUDED_ + @@ -831,6 +846,13 @@ index 0000000..5aa0397 + +#if (NGX_DTRACE) + ++#if (NGX_THREADS) ++# ifndef NGX_DEFINE_THREAD_POOL_T ++# define NGX_DEFINE_THREAD_POOL_T 1 ++typedef struct ngx_thread_pool_s ngx_thread_pool_t; ++# endif ++#endif ++ +#include +#include +