src/http/ngx_http_busy_lock.h - nginx-1.7.10

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_HTTP_BUSY_LOCK_H_INCLUDED_
  6. #define _NGX_HTTP_BUSY_LOCK_H_INCLUDED_


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


  11. typedef struct {
  12.     u_char             *md5_mask;
  13.     char               *md5;
  14.     int                 cacheable;

  15.     int                 busy;
  16.     int                 max_busy;

  17.     int                 waiting;
  18.     int                 max_waiting;

  19.     time_t              timeout;

  20.     ngx_event_mutex_t  *mutex;
  21. } ngx_http_busy_lock_t;


  22. typedef struct {
  23.     time_t         time;
  24.     ngx_event_t   *event;
  25.     void         (*event_handler)(ngx_event_t *ev);
  26.     u_char        *md5;
  27.     int            slot;
  28. } ngx_http_busy_lock_ctx_t;


  29. int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc);
  30. int ngx_http_busy_lock_cacheable(ngx_http_busy_lock_t *bl,
  31.                                  ngx_http_busy_lock_ctx_t *bc, int lock);
  32. void ngx_http_busy_unlock(ngx_http_busy_lock_t *bl,
  33.                           ngx_http_busy_lock_ctx_t *bc);

  34. char *ngx_http_set_busy_lock_slot(ngx_conf_t *cf, ngx_command_t *cmd,
  35.                                   void *conf);


  36. #endif /* _NGX_HTTP_BUSY_LOCK_H_INCLUDED_ */