mirror of https://github.com/F-Stack/f-stack.git
rename "timers" and "events_posted"
This commit is contained in:
parent
590bcd338b
commit
acc0462acd
|
@ -56,10 +56,10 @@ static void ngx_ff_process_events_and_timers(ngx_cycle_t *cycle);
|
||||||
ngx_int_t ngx_ff_start_worker_channel(ngx_cycle_t *cycle,
|
ngx_int_t ngx_ff_start_worker_channel(ngx_cycle_t *cycle,
|
||||||
ngx_fd_t fd, ngx_int_t event);
|
ngx_fd_t fd, ngx_int_t event);
|
||||||
|
|
||||||
void ngx_aeds_cancel_timers(void);
|
void ngx_event_cancel_timers_of_host(void);
|
||||||
void ngx_aeds_expire_timers(void);
|
void ngx_event_expire_timers_of_host(void);
|
||||||
ngx_msec_t ngx_aeds_find_timer(void);
|
ngx_msec_t ngx_event_find_timer_of_host(void);
|
||||||
void ngx_aeds_cancel_timers(void);
|
void ngx_event_cancel_timers_of_host(void);
|
||||||
|
|
||||||
struct channel_thread_args {
|
struct channel_thread_args {
|
||||||
ngx_cycle_t *cycle;
|
ngx_cycle_t *cycle;
|
||||||
|
@ -678,7 +678,7 @@ ngx_ff_host_event_thread_main(void *args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_aeds_cancel_timers();
|
ngx_event_cancel_timers_of_host();
|
||||||
|
|
||||||
ngx_free(cta);
|
ngx_free(cta);
|
||||||
|
|
||||||
|
@ -691,7 +691,7 @@ ngx_ff_process_events_and_timers(ngx_cycle_t *cycle)
|
||||||
ngx_uint_t flags;
|
ngx_uint_t flags;
|
||||||
ngx_msec_t timer, delta;
|
ngx_msec_t timer, delta;
|
||||||
|
|
||||||
timer = ngx_aeds_find_timer();
|
timer = ngx_event_find_timer_of_host();
|
||||||
flags = NGX_UPDATE_TIME;
|
flags = NGX_UPDATE_TIME;
|
||||||
|
|
||||||
/* handle signals from master in case of network inactivity */
|
/* handle signals from master in case of network inactivity */
|
||||||
|
@ -706,13 +706,13 @@ ngx_ff_process_events_and_timers(ngx_cycle_t *cycle)
|
||||||
|
|
||||||
delta = ngx_current_msec - delta;
|
delta = ngx_current_msec - delta;
|
||||||
|
|
||||||
ngx_event_process_posted(cycle, &ngx_posted_accept_events_of_aeds);
|
ngx_event_process_posted(cycle, &ngx_posted_accept_events_of_host);
|
||||||
|
|
||||||
if (delta) {
|
if (delta) {
|
||||||
ngx_aeds_expire_timers();
|
ngx_event_expire_timers_of_host();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_event_process_posted(cycle, &ngx_posted_events_of_aeds);
|
ngx_event_process_posted(cycle, &ngx_posted_events_of_host);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -608,8 +608,8 @@ ngx_event_process_init(ngx_cycle_t *cycle)
|
||||||
ngx_queue_init(&ngx_posted_events);
|
ngx_queue_init(&ngx_posted_events);
|
||||||
|
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
ngx_queue_init(&ngx_posted_accept_events_of_aeds);
|
ngx_queue_init(&ngx_posted_accept_events_of_host);
|
||||||
ngx_queue_init(&ngx_posted_events_of_aeds);
|
ngx_queue_init(&ngx_posted_events_of_host);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ngx_event_timer_init(cycle->log) == NGX_ERROR) {
|
if (ngx_event_timer_init(cycle->log) == NGX_ERROR) {
|
||||||
|
|
|
@ -14,8 +14,8 @@ ngx_queue_t ngx_posted_accept_events;
|
||||||
ngx_queue_t ngx_posted_events;
|
ngx_queue_t ngx_posted_events;
|
||||||
|
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
ngx_queue_t ngx_posted_accept_events_of_aeds;
|
ngx_queue_t ngx_posted_accept_events_of_host;
|
||||||
ngx_queue_t ngx_posted_events_of_aeds;
|
ngx_queue_t ngx_posted_events_of_host;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
if (1 == (ev)->belong_to_host) { \
|
if (1 == (ev)->belong_to_host) { \
|
||||||
if (q == &ngx_posted_events) { \
|
if (q == &ngx_posted_events) { \
|
||||||
ngx_queue_insert_tail( \
|
ngx_queue_insert_tail( \
|
||||||
&ngx_posted_events_of_aeds, &(ev)->queue); \
|
&ngx_posted_events_of_host, &(ev)->queue); \
|
||||||
} else if (q == &ngx_posted_accept_events) { \
|
} else if (q == &ngx_posted_accept_events) { \
|
||||||
ngx_queue_insert_tail( \
|
ngx_queue_insert_tail( \
|
||||||
&ngx_posted_accept_events_of_aeds, &(ev)->queue); \
|
&ngx_posted_accept_events_of_host, &(ev)->queue); \
|
||||||
} else { \
|
} else { \
|
||||||
ngx_log_error(NGX_LOG_EMERG, (ev)->log, 0, \
|
ngx_log_error(NGX_LOG_EMERG, (ev)->log, 0, \
|
||||||
"ngx_post_event: unkowned posted queue"); \
|
"ngx_post_event: unkowned posted queue"); \
|
||||||
|
@ -74,8 +74,8 @@ extern ngx_queue_t ngx_posted_accept_events;
|
||||||
extern ngx_queue_t ngx_posted_events;
|
extern ngx_queue_t ngx_posted_events;
|
||||||
|
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
extern ngx_queue_t ngx_posted_accept_events_of_aeds;
|
extern ngx_queue_t ngx_posted_accept_events_of_host;
|
||||||
extern ngx_queue_t ngx_posted_events_of_aeds;
|
extern ngx_queue_t ngx_posted_events_of_host;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _NGX_EVENT_POSTED_H_INCLUDED_ */
|
#endif /* _NGX_EVENT_POSTED_H_INCLUDED_ */
|
||||||
|
|
|
@ -14,8 +14,8 @@ ngx_rbtree_t ngx_event_timer_rbtree;
|
||||||
static ngx_rbtree_node_t ngx_event_timer_sentinel;
|
static ngx_rbtree_node_t ngx_event_timer_sentinel;
|
||||||
|
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
ngx_rbtree_t ngx_aeds_timer_rbtree;
|
ngx_rbtree_t ngx_event_timer_rbtree_of_host;
|
||||||
static ngx_rbtree_node_t ngx_aeds_timer_sentinel;
|
static ngx_rbtree_node_t ngx_event_timer_sentinel_of_host;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -32,7 +32,7 @@ ngx_event_timer_init(ngx_log_t *log)
|
||||||
|
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
|
|
||||||
ngx_rbtree_init(&ngx_aeds_timer_rbtree, &ngx_aeds_timer_sentinel,
|
ngx_rbtree_init(&ngx_event_timer_rbtree_of_host, &ngx_event_timer_sentinel_of_host,
|
||||||
ngx_rbtree_insert_timer_value);
|
ngx_rbtree_insert_timer_value);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,9 +53,9 @@ ngx_event_find_timer(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_msec_t
|
ngx_msec_t
|
||||||
ngx_aeds_find_timer(void)
|
ngx_event_find_timer_of_host(void)
|
||||||
{
|
{
|
||||||
return ngx_event_find_timer_internal(&ngx_aeds_timer_rbtree, &ngx_aeds_timer_sentinel);
|
return ngx_event_find_timer_internal(&ngx_event_timer_rbtree_of_host, &ngx_event_timer_sentinel_of_host);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_msec_t
|
ngx_msec_t
|
||||||
|
@ -99,9 +99,9 @@ ngx_event_expire_timers(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ngx_aeds_expire_timers(void)
|
ngx_event_expire_timers_of_host(void)
|
||||||
{
|
{
|
||||||
ngx_event_expire_timers_internal(&ngx_aeds_timer_rbtree);
|
ngx_event_expire_timers_internal(&ngx_event_timer_rbtree_of_host);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -168,9 +168,9 @@ ngx_event_cancel_timers(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ngx_aeds_cancel_timers(void)
|
ngx_event_cancel_timers_of_host(void)
|
||||||
{
|
{
|
||||||
ngx_event_cancel_timers_internal(&ngx_aeds_timer_rbtree);
|
ngx_event_cancel_timers_internal(&ngx_event_timer_rbtree_of_host);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -28,7 +28,7 @@ void ngx_event_cancel_timers(void);
|
||||||
extern ngx_rbtree_t ngx_event_timer_rbtree;
|
extern ngx_rbtree_t ngx_event_timer_rbtree;
|
||||||
|
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
extern ngx_rbtree_t ngx_aeds_timer_rbtree;
|
extern ngx_rbtree_t ngx_event_timer_rbtree_of_host;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static ngx_inline void
|
static ngx_inline void
|
||||||
|
@ -41,7 +41,7 @@ ngx_event_del_timer(ngx_event_t *ev)
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
|
|
||||||
if(ev->belong_to_host){
|
if(ev->belong_to_host){
|
||||||
ngx_rbtree_delete(&ngx_aeds_timer_rbtree, &ev->timer);
|
ngx_rbtree_delete(&ngx_event_timer_rbtree_of_host, &ev->timer);
|
||||||
} else {
|
} else {
|
||||||
ngx_rbtree_delete(&ngx_event_timer_rbtree, &ev->timer);
|
ngx_rbtree_delete(&ngx_event_timer_rbtree, &ev->timer);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer)
|
||||||
#if (NGX_HAVE_FSTACK)
|
#if (NGX_HAVE_FSTACK)
|
||||||
|
|
||||||
if(ev->belong_to_host){
|
if(ev->belong_to_host){
|
||||||
ngx_rbtree_insert(&ngx_aeds_timer_rbtree, &ev->timer);
|
ngx_rbtree_insert(&ngx_event_timer_rbtree_of_host, &ev->timer);
|
||||||
} else {
|
} else {
|
||||||
ngx_rbtree_insert(&ngx_event_timer_rbtree, &ev->timer);
|
ngx_rbtree_insert(&ngx_event_timer_rbtree, &ev->timer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue