__decl_hathreads(extern HA_SPINLOCK_T buffer_wq_lock);
int init_buffer();
-void deinit_buffer();
void buffer_dump(FILE *o, struct buffer *b, int from, int to);
/*****************************************************************/
struct buffer *get_trash_chunk(void);
struct buffer *alloc_trash_chunk(void);
int init_trash_buffers(int first);
-void deinit_trash_buffers(void);
/*
* free a trash chunk allocated by alloc_trash_chunk(). NOP on NULL.
* This should be called only under extreme circumstances.
*/
void *pool_destroy(struct pool_head *pool);
+void pool_destroy_all();
/* returns the pool index for pool <pool>, or -1 if this pool has no index */
static inline ssize_t pool_get_index(const struct pool_head *pool)
extern int signal_queue_len;
extern struct signal_descriptor signal_state[];
-extern struct pool_head *pool_head_sig_handlers;
__decl_hathreads(extern HA_SPINLOCK_T signals_lock);
return 1;
}
-void deinit_buffer()
-{
- pool_destroy(pool_head_buffer);
-}
-
/*
* Dumps part or all of a buffer.
*/
return 1;
}
-/*
- * free the trash buffers
- */
-void deinit_trash_buffers(void)
-{
- pool_destroy(pool_head_trash);
-}
-
/*
* Allocate a trash chunk from the reentrant pool. The buffer starts at the
* end of the chunk. This chunk must be freed using free_trash_chunk(). This
LIST_DEL(&srvrq->list);
free(srvrq);
}
-
- pool_destroy(dns_answer_item_pool);
- pool_destroy(dns_resolution_pool);
}
/* Finalizes the DNS configuration by allocating required resources and checking
INITCALL1(STG_REGISTER, cfg_register_keywords, &cfg_kws);
-__attribute__((destructor))
-static void
-__filters_deinit(void)
-{
- pool_destroy(pool_head_filter);
-}
-
REGISTER_POST_CHECK(flt_init_all);
REGISTER_PER_THREAD_INIT(flt_init_all_per_thread);
REGISTER_PER_THREAD_DEINIT(flt_deinit_all_per_thread);
};
INITCALL1(STG_REGISTER, http_res_keywords_register, &http_res_action_kws);
-
-__attribute__((destructor))
-static void
-__spoe_deinit(void)
-{
- pool_destroy(pool_head_spoe_ctx);
- pool_destroy(pool_head_spoe_appctx);
-}
cfg_unregister_sections();
deinit_log_buffers();
- deinit_trash_buffers();
protocol_unbind_all();
}
vars_prune(&global.vars, NULL, NULL);
-
- deinit_buffer();
-
- pool_destroy(pool_head_stream);
- pool_destroy(pool_head_session);
- pool_destroy(pool_head_connection);
- pool_destroy(pool_head_connstream);
- pool_destroy(pool_head_requri);
- pool_destroy(pool_head_task);
- pool_destroy(pool_head_capture);
- pool_destroy(pool_head_pendconn);
- pool_destroy(pool_head_sig_handlers);
- pool_destroy(pool_head_hdr_idx);
- pool_destroy(pool_head_http_txn);
+ pool_destroy_all();
deinit_pollers();
} /* end deinit() */
return NULL;
}
+/* This destroys all pools on exit. It is *not* thread safe. */
+void pool_destroy_all()
+{
+ struct pool_head *entry, *back;
+
+ list_for_each_entry_safe(entry, back, &pools, list)
+ pool_destroy(entry);
+}
+
/* This function dumps memory usage information into the trash buffer. */
void dump_pools_to_trash()
{
INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_htx);
-static void __h1_deinit(void)
-{
- pool_destroy(pool_head_h1c);
- pool_destroy(pool_head_h1s);
-}
-
-REGISTER_POST_DEINIT(__h1_deinit);
-
/*
* Local variables:
* c-indent-level: 8
}};
INITCALL1(STG_REGISTER, cfg_register_keywords, &cfg_kws);
-
-static void __h2_deinit(void)
-{
- pool_destroy(pool_head_h2s);
- pool_destroy(pool_head_h2c);
-}
-
-REGISTER_POST_DEINIT(__h2_deinit);
sigset_t blocked_sig;
int signal_pending = 0; /* non-zero if t least one signal remains unprocessed */
-DECLARE_POOL(pool_head_sig_handlers, "sig_handlers", sizeof(struct sig_handler));
+DECLARE_STATIC_POOL(pool_head_sig_handlers, "sig_handlers", sizeof(struct sig_handler));
/* Common signal handler, used by all signals. Received signals are queued.
* Signal number zero has a specific status, as it cannot be delivered by the