Nginx的队列

队列数据结构:
struct ngx_queue_s {
ngx_queue_t *prev;
ngx_queue_t *next;
};
队列的其它操作没有什么,取值比较有意思
#define ngx_queue_data(q, type, link) \
(type *) ((u_char *) q – offsetof(type, link))
根据link在type中的偏移计算整个结构的内存地址


Leave a comment

Your comment