Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 2 | * include/proto/signal.h |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 3 | * Asynchronous signal delivery functions. |
| 4 | * |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 5 | * Copyright 2000-2010 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License |
| 9 | * as published by the Free Software Foundation; either version |
| 10 | * 2 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <signal.h> |
Willy Tarreau | 3f567e4 | 2020-05-28 15:29:19 +0200 | [diff] [blame] | 15 | #include <haproxy/thread.h> |
Christopher Faulet | b79a94c | 2017-05-30 15:34:30 +0200 | [diff] [blame] | 16 | |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 17 | #include <types/signal.h> |
Willy Tarreau | cea0e1b | 2020-06-04 17:25:40 +0200 | [diff] [blame^] | 18 | #include <haproxy/task-t.h> |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 19 | |
| 20 | extern int signal_queue_len; |
| 21 | extern struct signal_descriptor signal_state[]; |
| 22 | |
Willy Tarreau | af613e8 | 2020-06-05 08:40:51 +0200 | [diff] [blame] | 23 | __decl_thread(extern HA_SPINLOCK_T signals_lock); |
Christopher Faulet | b79a94c | 2017-05-30 15:34:30 +0200 | [diff] [blame] | 24 | |
Willy Tarreau | d0807c3 | 2010-08-27 18:26:11 +0200 | [diff] [blame] | 25 | void signal_handler(int sig); |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 26 | void __signal_process_queue(); |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 27 | void deinit_signals(); |
| 28 | struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler *), int arg); |
| 29 | struct sig_handler *signal_register_task(int sig, struct task *task, int reason); |
| 30 | void signal_unregister_handler(struct sig_handler *handler); |
| 31 | void signal_unregister_target(int sig, void *target); |
William Lallemand | 31a1c1d | 2018-11-20 17:36:52 +0100 | [diff] [blame] | 32 | void signal_unregister(int sig); |
William Lallemand | d3801c1 | 2018-09-11 10:06:23 +0200 | [diff] [blame] | 33 | void haproxy_unblock_signals(); |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 34 | |
| 35 | static inline void signal_process_queue() |
| 36 | { |
| 37 | if (unlikely(signal_queue_len > 0)) |
| 38 | __signal_process_queue(); |
| 39 | } |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * Local variables: |
| 43 | * c-indent-level: 8 |
| 44 | * c-basic-offset: 8 |
| 45 | * End: |
| 46 | */ |