2004-04-04 15:32:09 -05:00
|
|
|
#ifndef _NGX_EVENT_POSTED_H_INCLUDED_
|
|
|
|
#define _NGX_EVENT_POSTED_H_INCLUDED_
|
|
|
|
|
|
|
|
|
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
|
|
|
#include <ngx_event.h>
|
|
|
|
|
|
|
|
|
|
|
|
#define ngx_post_event(ev) \
|
2004-06-28 16:03:14 -05:00
|
|
|
if (!ev->posted) { \
|
2004-04-04 15:32:09 -05:00
|
|
|
ev->next = (ngx_event_t *) ngx_posted_events; \
|
|
|
|
ngx_posted_events = ev; \
|
2004-06-28 16:03:14 -05:00
|
|
|
ev->posted = 1; \
|
2004-06-30 10:30:41 -05:00
|
|
|
\
|
|
|
|
ngx_log_debug3(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0, \
|
|
|
|
"POST: %08X %08X %08X", ngx_posted_events, \
|
|
|
|
(ngx_posted_events ? ngx_posted_events->next: 0), \
|
|
|
|
((ngx_posted_events && ngx_posted_events->next) ? \
|
|
|
|
ngx_posted_events->next->next: 0)); \
|
|
|
|
\
|
2004-07-02 00:47:00 -05:00
|
|
|
}
|
2004-06-30 10:30:41 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
\
|
|
|
|
{ int i; ngx_event_t *e;\
|
|
|
|
e = (ngx_event_t *) ngx_posted_events; \
|
|
|
|
for (i = 0; e && i < 10; e = e->next, i++) { \
|
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0, \
|
|
|
|
"POST: %d %08X", i, e);\
|
|
|
|
}} \
|
|
|
|
\
|
|
|
|
*/
|
|
|
|
|
2004-04-04 15:32:09 -05:00
|
|
|
|
|
|
|
void ngx_event_process_posted(ngx_cycle_t *cycle);
|
|
|
|
|
|
|
|
extern ngx_thread_volatile ngx_event_t *ngx_posted_events;
|
2004-06-27 13:01:57 -05:00
|
|
|
|
|
|
|
|
2004-04-04 15:32:09 -05:00
|
|
|
#if (NGX_THREADS)
|
2004-06-27 13:01:57 -05:00
|
|
|
ngx_int_t ngx_event_thread_process_posted(ngx_cycle_t *cycle);
|
|
|
|
|
2004-04-04 15:32:09 -05:00
|
|
|
extern ngx_mutex_t *ngx_posted_events_mutex;
|
2004-06-28 11:05:02 -05:00
|
|
|
extern ngx_cond_t *ngx_posted_events_cv;
|
2004-04-04 15:32:09 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _NGX_EVENT_POSTED_H_INCLUDED_ */
|