flow: new flow queue: flow_recycle_q

This queue will be used by the FlowManager to pass timed out flows
to another thread that will do the actual cleanup.
pull/1058/head
Victor Julien 12 years ago
parent fdd407751e
commit e892d99827

@ -78,6 +78,9 @@ FlowProto flow_proto[FLOW_PROTO_MAX];
/** spare/unused/prealloced flows live here */
FlowQueue flow_spare_q;
/** queue to pass flows to cleanup/log thread(s) */
FlowQueue flow_recycle_q;
FlowBucket *flow_hash;
FlowConfig flow_config;

@ -304,6 +304,7 @@ void FlowInitConfig(char quiet)
SC_ATOMIC_INIT(flow_memuse);
SC_ATOMIC_INIT(flow_prune_idx);
FlowQueueInit(&flow_spare_q);
FlowQueueInit(&flow_recycle_q);
unsigned int seed = RandomTimePreseed();
/* set defaults */
@ -470,6 +471,7 @@ void FlowShutdown(void)
}
(void) SC_ATOMIC_SUB(flow_memuse, flow_config.hash_size * sizeof(FlowBucket));
FlowQueueDestroy(&flow_spare_q);
FlowQueueDestroy(&flow_recycle_q);
SC_ATOMIC_DESTROY(flow_prune_idx);
SC_ATOMIC_DESTROY(flow_memuse);

Loading…
Cancel
Save