haproxy/include/proto/signal.h
Willy Tarreau 2455cebe00 MEDIUM: memory: use pool_destroy_all() to destroy all pools on deinit()
Instead of exporting a number of pools and having to manually delete
them in deinit() or to have dedicated destructors to remove them, let's
simply kill all pools on deinit().

For this a new function pool_destroy_all() was introduced. As its name
implies, it destroys and frees all pools (provided they don't have any
user anymore of course).

This allowed to remove 4 implicit destructors, 2 explicit ones, and 11
individual calls to pool_destroy(). In addition it properly removes
the mux_pt_ctx pool which was not cleared on exit (no backport needed
here since it's 1.9 only). The sig_handler pool doesn't need to be
exported anymore and became static now.
2018-11-26 19:50:32 +01:00

49 lines
1.3 KiB
C

/*
* include/proto/signal.h
* Asynchronous signal delivery functions.
*
* Copyright 2000-2010 Willy Tarreau <w@1wt.eu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
*/
#include <signal.h>
#include <common/standard.h>
#include <common/hathreads.h>
#include <types/signal.h>
#include <types/task.h>
extern int signal_queue_len;
extern struct signal_descriptor signal_state[];
__decl_hathreads(extern HA_SPINLOCK_T signals_lock);
void signal_handler(int sig);
void __signal_process_queue();
int signal_init();
void deinit_signals();
struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler *), int arg);
struct sig_handler *signal_register_task(int sig, struct task *task, int reason);
void signal_unregister_handler(struct sig_handler *handler);
void signal_unregister_target(int sig, void *target);
void signal_unregister(int sig);
void haproxy_unblock_signals();
static inline void signal_process_queue()
{
if (unlikely(signal_queue_len > 0))
__signal_process_queue();
}
/*
* Local variables:
* c-indent-level: 8
* c-basic-offset: 8
* End:
*/