comparison src/event/ngx_event_busy_lock.h @ 276:a2d1ccc96111

nginx-0.0.2-2004-03-03-00:14:37 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 02 Mar 2004 21:14:37 +0000
parents
children e91499541410
comparison
equal deleted inserted replaced
275:b836469c37c3 276:a2d1ccc96111
1 #ifndef _NGX_EVENT_BUSY_LOCK_H_INCLUDED_
2 #define _NGX_EVENT_BUSY_LOCK_H_INCLUDED_
3
4
5 #include <ngx_config.h>
6 #include <ngx_core.h>
7 #include <ngx_event.h>
8
9 typedef struct ngx_event_busy_lock_ctx_s ngx_event_busy_lock_ctx_t;
10
11 struct ngx_event_busy_lock_ctx_s {
12 ngx_event_t *event;
13 ngx_event_handler_pt handler;
14 void *data;
15 ngx_msec_t timer;
16
17 unsigned locked:1;
18 unsigned cache_updated:1;
19
20 char *md5;
21 ngx_int_t slot;
22
23 ngx_event_busy_lock_ctx_t *next;
24 };
25
26
27 typedef struct {
28 u_char *md5_mask;
29 char *md5;
30 ngx_uint_t cachable;
31
32 ngx_uint_t busy;
33 ngx_uint_t max_busy;
34
35 ngx_uint_t waiting;
36 ngx_uint_t max_waiting;
37
38 ngx_event_busy_lock_ctx_t *events;
39 ngx_event_busy_lock_ctx_t *last;
40
41 #if (NGX_THREADS)
42 ngx_mutex_t *mutex;
43 #endif
44 } ngx_event_busy_lock_t;
45
46
47 ngx_int_t ngx_event_busy_lock(ngx_event_busy_lock_t *bl,
48 ngx_event_busy_lock_ctx_t *ctx);
49 ngx_int_t ngx_event_busy_lock_cachable(ngx_event_busy_lock_t *bl,
50 ngx_event_busy_lock_ctx_t *ctx);
51 ngx_int_t ngx_event_busy_unlock(ngx_event_busy_lock_t *bl,
52 ngx_event_busy_lock_ctx_t *ctx);
53 ngx_int_t ngx_event_busy_lock_cancel(ngx_event_busy_lock_t *bl,
54 ngx_event_busy_lock_ctx_t *ctx);
55
56
57 #endif /* _NGX_EVENT_BUSY_LOCK_H_INCLUDED_ */