comparison src/http/ngx_http_busy_lock.h @ 176:c0552e5ab567

nginx-0.0.1-2003-11-09-23:03:38 import; separate building
author Igor Sysoev <igor@sysoev.ru>
date Sun, 09 Nov 2003 20:03:38 +0000
parents e92c2c647c57
children a8ff48d26cca
comparison
equal deleted inserted replaced
175:e92c2c647c57 176:c0552e5ab567
2 #define _NGX_HTTP_BUSY_LOCK_H_INCLUDED_ 2 #define _NGX_HTTP_BUSY_LOCK_H_INCLUDED_
3 3
4 4
5 #include <ngx_config.h> 5 #include <ngx_config.h>
6 #include <ngx_core.h> 6 #include <ngx_core.h>
7 #include <ngx_event.h>
7 #include <ngx_http.h> 8 #include <ngx_http.h>
8 9
9 10
10 typedef struct { 11 typedef struct {
11 u_char *busy_mask; 12 u_char *md5_mask;
12 char *busy; 13 char *md5;
13 int busy_n; 14 int cachable;
14 15
15 int waiting_n; 16 int busy;
17 int max_busy;
18
19 int waiting;
16 int max_waiting; 20 int max_waiting;
17
18 int conn_n;
19 int max_conn;
20 21
21 time_t timeout; 22 time_t timeout;
22 23
23 /* ngx_mutex_t mutex; */ 24 /* ngx_mutex_t mutex; */
24 25
25 } ngx_http_busy_lock_t; 26 } ngx_http_busy_lock_t;
26 27
27 28
28 int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, u_char *md5); 29 typedef struct {
30 time_t time;
31 ngx_event_t *event;
32 void (*event_handler)(ngx_event_t *ev);
33 u_char *md5;
34 int slot;
35 } ngx_http_busy_lock_ctx_t;
36
37
38 int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc);
39 int ngx_http_busy_lock_cachable(ngx_http_busy_lock_t *bl,
40 ngx_http_busy_lock_ctx_t *bc, int lock);
41 void ngx_http_busy_unlock_cachable(ngx_http_busy_lock_t *bl,
42 ngx_http_busy_lock_ctx_t *bc);
43
29 char *ngx_http_set_busy_lock_slot(ngx_conf_t *cf, ngx_command_t *cmd, 44 char *ngx_http_set_busy_lock_slot(ngx_conf_t *cf, ngx_command_t *cmd,
30 void *conf); 45 void *conf);
31 46
32 47
33 #endif /* _NGX_HTTP_BUSY_LOCK_H_INCLUDED_ */ 48 #endif /* _NGX_HTTP_BUSY_LOCK_H_INCLUDED_ */