Changeset 6733:adc2414856b1 in nginx


Ignore:
Timestamp:
10/10/16 15:44:17 (3 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Phase:
public
Message:

Modules compatibility: compatibility with NGX_THREADS.

With this change it is now possible to load modules compiled without
the "--with-threads" configure option into nginx binary compiled with it,
and vice versa (if a module does not use thread-specific functions),
assuming both use the "--with-compat" option.

Location:
src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/core/ngx_buf.h

    r6698 r6733  
    8989    unsigned                     need_in_memory:1;
    9090    unsigned                     need_in_temp:1;
    91 #if (NGX_HAVE_FILE_AIO || NGX_THREADS)
    9291    unsigned                     aio:1;
    93 #endif
    9492
    9593#if (NGX_HAVE_FILE_AIO)
     
    10098#endif
    10199
    102 #if (NGX_THREADS)
     100#if (NGX_THREADS || NGX_COMPAT)
    103101    ngx_int_t                  (*thread_handler)(ngx_thread_task_t *task,
    104102                                                 ngx_file_t *file);
  • src/core/ngx_connection.h

    r6721 r6733  
    187187#endif
    188188
    189 #if (NGX_THREADS)
     189#if (NGX_THREADS || NGX_COMPAT)
    190190    ngx_thread_task_t  *sendfile_task;
    191191#endif
  • src/core/ngx_core.h

    r6380 r6733  
    1313
    1414
    15 typedef struct ngx_module_s      ngx_module_t;
    16 typedef struct ngx_conf_s        ngx_conf_t;
    17 typedef struct ngx_cycle_s       ngx_cycle_t;
    18 typedef struct ngx_pool_s        ngx_pool_t;
    19 typedef struct ngx_chain_s       ngx_chain_t;
    20 typedef struct ngx_log_s         ngx_log_t;
    21 typedef struct ngx_open_file_s   ngx_open_file_t;
    22 typedef struct ngx_command_s     ngx_command_t;
    23 typedef struct ngx_file_s        ngx_file_t;
    24 typedef struct ngx_event_s       ngx_event_t;
    25 typedef struct ngx_event_aio_s   ngx_event_aio_t;
    26 typedef struct ngx_connection_s  ngx_connection_t;
    27 
    28 #if (NGX_THREADS)
     15typedef struct ngx_module_s       ngx_module_t;
     16typedef struct ngx_conf_s         ngx_conf_t;
     17typedef struct ngx_cycle_s        ngx_cycle_t;
     18typedef struct ngx_pool_s         ngx_pool_t;
     19typedef struct ngx_chain_s        ngx_chain_t;
     20typedef struct ngx_log_s          ngx_log_t;
     21typedef struct ngx_open_file_s    ngx_open_file_t;
     22typedef struct ngx_command_s      ngx_command_t;
     23typedef struct ngx_file_s         ngx_file_t;
     24typedef struct ngx_event_s        ngx_event_t;
     25typedef struct ngx_event_aio_s    ngx_event_aio_t;
     26typedef struct ngx_connection_s   ngx_connection_t;
    2927typedef struct ngx_thread_task_s  ngx_thread_task_t;
    30 #endif
    3128
    3229typedef void (*ngx_event_handler_pt)(ngx_event_t *ev);
  • src/core/ngx_file.h

    r6727 r6733  
    2424    ngx_log_t                 *log;
    2525
    26 #if (NGX_THREADS)
     26#if (NGX_THREADS || NGX_COMPAT)
    2727    ngx_int_t                (*thread_handler)(ngx_thread_task_t *task,
    2828                                               ngx_file_t *file);
  • src/core/ngx_module.h

    r6721 r6733  
    128128#endif
    129129
    130 #if (NGX_THREADS)
     130#if (NGX_THREADS || NGX_COMPAT)
    131131#define NGX_MODULE_SIGNATURE_22  "1"
    132132#else
  • src/event/ngx_event_pipe.h

    r6443 r6733  
    4848    void                             *output_ctx;
    4949
    50 #if (NGX_THREADS)
     50#if (NGX_THREADS || NGX_COMPAT)
    5151    ngx_int_t                       (*thread_handler)(ngx_thread_task_t *task,
    5252                                                      ngx_file_t *file);
  • src/http/ngx_http_cache.h

    r6727 r6733  
    9494    ngx_http_file_cache_node_t      *node;
    9595
    96 #if (NGX_THREADS)
     96#if (NGX_THREADS || NGX_COMPAT)
    9797    ngx_thread_task_t               *thread_task;
    9898#endif
  • src/http/ngx_http_core_module.h

    r6721 r6733  
    1616#if (NGX_THREADS)
    1717#include <ngx_thread_pool.h>
     18#elif (NGX_COMPAT)
     19typedef struct ngx_thread_pool_s  ngx_thread_pool_t;
    1820#endif
    1921
     
    410412#endif
    411413
    412 #if (NGX_THREADS)
     414#if (NGX_THREADS || NGX_COMPAT)
    413415    ngx_thread_pool_t         *thread_pool;
    414416    ngx_http_complex_value_t  *thread_pool_value;
Note: See TracChangeset for help on using the changeset viewer.