mirror of
https://github.com/nginx/nginx.git
synced 2024-11-29 09:19:00 +08:00
Events: made posted events macros safe.
This commit is contained in:
parent
0e853129ac
commit
3ffbf84a5e
@ -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);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user