|
24 | 24 | #include "storage/procarray.h"
|
25 | 25 | #include "storage/shm_mq.h"
|
26 | 26 | #include "storage/shm_toc.h"
|
| 27 | +#include "tcop/tcopprot.h" |
27 | 28 |
|
28 | 29 | #include "test_shm_mq.h"
|
29 | 30 |
|
30 |
| -static void handle_sigterm(SIGNAL_ARGS); |
31 | 31 | static void attach_to_queues(dsm_segment *seg, shm_toc *toc,
|
32 | 32 | int myworkernumber, shm_mq_handle **inqhp,
|
33 | 33 | shm_mq_handle **outqhp);
|
@@ -58,10 +58,9 @@ test_shm_mq_main(Datum main_arg)
|
58 | 58 | * Establish signal handlers.
|
59 | 59 | *
|
60 | 60 | * We want CHECK_FOR_INTERRUPTS() to kill off this worker process just as
|
61 |
| - * it would a normal user backend. To make that happen, we establish a |
62 |
| - * signal handler that is a stripped-down version of die(). |
| 61 | + * it would a normal user backend. To make that happen, we use die(). |
63 | 62 | */
|
64 |
| - pqsignal(SIGTERM, handle_sigterm); |
| 63 | + pqsignal(SIGTERM, die); |
65 | 64 | BackgroundWorkerUnblockSignals();
|
66 | 65 |
|
67 | 66 | /*
|
@@ -196,24 +195,3 @@ copy_messages(shm_mq_handle *inqh, shm_mq_handle *outqh)
|
196 | 195 | break;
|
197 | 196 | }
|
198 | 197 | }
|
199 |
| - |
200 |
| -/* |
201 |
| - * When we receive a SIGTERM, we set InterruptPending and ProcDiePending just |
202 |
| - * like a normal backend. The next CHECK_FOR_INTERRUPTS() will do the right |
203 |
| - * thing. |
204 |
| - */ |
205 |
| -static void |
206 |
| -handle_sigterm(SIGNAL_ARGS) |
207 |
| -{ |
208 |
| - int save_errno = errno; |
209 |
| - |
210 |
| - SetLatch(MyLatch); |
211 |
| - |
212 |
| - if (!proc_exit_inprogress) |
213 |
| - { |
214 |
| - InterruptPending = true; |
215 |
| - ProcDiePending = true; |
216 |
| - } |
217 |
| - |
218 |
| - errno = save_errno; |
219 |
| -} |
0 commit comments