src/core/ngx_thread_pool.h - nginx source code

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Nginx, Inc.
  3. * Copyright (C) Valentin V. Bartenev
  4. */


  5. #ifndef _NGX_THREAD_POOL_H_INCLUDED_
  6. #define _NGX_THREAD_POOL_H_INCLUDED_


  7. #include <ngx_config.h>
  8. #include <ngx_core.h>
  9. #include <ngx_event.h>


  10. struct ngx_thread_task_s {
  11.     ngx_thread_task_t   *next;
  12.     ngx_uint_t           id;
  13.     void                *ctx;
  14.     void               (*handler)(void *data, ngx_log_t *log);
  15.     ngx_event_t          event;
  16. };


  17. typedef struct ngx_thread_pool_s  ngx_thread_pool_t;


  18. ngx_thread_pool_t *ngx_thread_pool_add(ngx_conf_t *cf, ngx_str_t *name);
  19. ngx_thread_pool_t *ngx_thread_pool_get(ngx_cycle_t *cycle, ngx_str_t *name);

  20. ngx_thread_task_t *ngx_thread_task_alloc(ngx_pool_t *pool, size_t size);
  21. ngx_int_t ngx_thread_task_post(ngx_thread_pool_t *tp, ngx_thread_task_t *task);


  22. #endif /* _NGX_THREAD_POOL_H_INCLUDED_ */