-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathngx_timerd.h
More file actions
86 lines (61 loc) · 1.83 KB
/
ngx_timerd.h
File metadata and controls
86 lines (61 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com
*/
#ifndef _NGX_TIMER_DEBUG_H_INCLUDED_
#define _NGX_TIMER_DEBUG_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#if (NGX_DEBUG)
#define NGX_ADD_TIMER(ev, timer, fpoff) \
ngx_add_timer_debug(ev, timer, fpoff, __FILE__, __LINE__)
#else
#define NGX_ADD_TIMER(ev, timer, fpoff) \
ngx_add_timer(ev, timer)
#endif
#if (NGX_DEBUG)
#define NGX_DEL_TIMER(ev, footprint) \
ngx_del_timer_debug(ev, footprint, __FILE__, __LINE__)
#else
#define NGX_DEL_TIMER(ev, footprint) \
ngx_del_timer(ev)
#endif
/*
* generate a new footprint
*
* return:
* footprint
*/
ngx_uint_t ngx_timerd_footprint();
/*
* add timer and record where to add it for debugging
* such as timer not destroy
*
* paras:
* ev: nginx event for timer
* timer: timer interval for triggering timer
* fpoff: footprint offset in event data
* file: use __FILE__ for recording file
* line: use __LINE__ for recording line
* return:
* pool for successd, NULL for failed
*/
void ngx_add_timer_debug(ngx_event_t *ev, ngx_msec_t timer, off_t fpoff,
char *file, int line);
/*
* destroy pool for debugging, use as pair for ngx_create_pool_debug
*
* paras:
* ev: nginx event for timer
* footprint: footprint value in user event data
* file: use __FILE__ for recording file
* line: use __LINE__ for recording line
*/
void ngx_del_timer_debug(ngx_event_t *ev, ngx_uint_t footprint,
char *file, int line);
/*
* paras:
* r: http request to query status of rbuf
*/
ngx_chain_t *ngx_timerd_state(ngx_http_request_t *r, unsigned detail);
#endif