From 07cc76a38be9a6bf54e55d7a48f2e531661f45c4 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Fri, 9 Mar 2001 06:36:32 +0000 Subject: [PATCH] hold interupts during LockWaitCancel(). --- src/backend/tcop/postgres.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 717770d8b6..224bcf102f 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -946,9 +946,13 @@ die(SIGNAL_ARGS) if (ImmediateInterruptOK && InterruptHoldoffCount == 0 && CritSectionCount == 0) { + /* bump holdoff count to make ProcessInterrupts() a no-op */ + /* until we are done getting ready for it */ + InterruptHoldoffCount++; DisableNotifyInterrupt(); /* Make sure HandleDeadLock won't run while shutting down... */ LockWaitCancel(); + InterruptHoldoffCount--; ProcessInterrupts(); } } @@ -976,10 +980,19 @@ QueryCancelHandler(SIGNAL_ARGS) * if we're waiting for input, however. */ if (ImmediateInterruptOK && InterruptHoldoffCount == 0 && - CritSectionCount == 0 && LockWaitCancel()) + CritSectionCount == 0) { - DisableNotifyInterrupt(); - ProcessInterrupts(); + /* bump holdoff count to make ProcessInterrupts() a no-op */ + /* until we are done getting ready for it */ + InterruptHoldoffCount++; + if (LockWaitCancel()) + { + InterruptHoldoffCount--; + DisableNotifyInterrupt(); + ProcessInterrupts(); + } + else + InterruptHoldoffCount--; } } @@ -1680,7 +1693,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.208 $ $Date: 2001/02/24 02:04:51 $\n"); + puts("$Revision: 1.209 $ $Date: 2001/03/09 06:36:32 $\n"); } /* -- 2.39.5