Events: made posted events macros safe.

This commit is contained in:
Valentin Bartenev 2015-03-27 19:57:15 +03:00
parent 0e853129ac
commit 3ffbf84a5e

View File

@ -16,24 +16,24 @@
#define ngx_post_event(ev, q) \
\
if (!ev->posted) { \
ev->posted = 1; \
ngx_queue_insert_tail(q, &ev->queue); \
if (!(ev)->posted) { \
(ev)->posted = 1; \
ngx_queue_insert_tail(q, &(ev)->queue); \
\
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "post event %p", ev); \
ngx_log_debug1(NGX_LOG_DEBUG_CORE, (ev)->log, 0, "post event %p", ev);\
\
} else { \
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
ngx_log_debug1(NGX_LOG_DEBUG_CORE, (ev)->log, 0, \
"update posted event %p", ev); \
}
#define ngx_delete_posted_event(ev) \
\
ev->posted = 0; \
ngx_queue_remove(&ev->queue); \
(ev)->posted = 0; \
ngx_queue_remove(&(ev)->queue); \
\
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
ngx_log_debug1(NGX_LOG_DEBUG_CORE, (ev)->log, 0, \
"delete posted event %p", ev);