-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathngx_timer_heap4.c
36 lines (23 loc) · 1.04 KB
/
ngx_timer_heap4.c
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
#include <ngx_event.h>
#include <ngx_heap.h>
#define NGX_HEAP_FREE_EVENTS 100
static ngx_thread_volatile ngx_heap_t ngx_timer_heap4;
#define NGX_TREE_INIT(cycle) \
ngx_heap4_init(&ngx_timer_heap4, cycle->pool, \
cycle->connection_n * 2 + NGX_HEAP_FREE_EVENTS)
#define NGX_TREE_DELETE(timer) ngx_heap4_delete(&ngx_timer_heap4, (ngx_heap_node_t *)timer)
#define NGX_TREE_INSERT(timer) ngx_heap4_insert(&ngx_timer_heap4, (ngx_heap_node_t *)timer)
#define NGX_TREE_ADJUST(timer) ngx_heap4_adjust(&ngx_timer_heap4, (ngx_heap_node_t *)timer)
#define NGX_TREE_MIN() (void *)ngx_heap4_min(&ngx_timer_heap4)
#define NGX_TREE_EMPTY() ngx_heap4_empty(&ngx_timer_heap4)
#define NGX_TIMER_TREE_PREFIX ngx_timer_heap4
#include <ngx_timer_tree_template.h>
ngx_timer_actions_t ngx_timer_heap4_actions = {
ngx_string("heap4"),
NGX_TIMER_TREE_ADD,
NGX_TIMER_TREE_DEL,
NGX_TIMER_TREE_EMPTY,
NGX_TIMER_TREE_FIND_MIN,
NGX_TIMER_TREE_EXPIRE_TIMERS,
NGX_TIMER_TREE_INIT
};