|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.208 2001/02/24 02:04:51 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.209 2001/03/09 06:36:32 inoue Exp $ |
12 | 12 | *
|
13 | 13 | * NOTES
|
14 | 14 | * this is the "main" module of the postgres backend and
|
@@ -946,9 +946,13 @@ die(SIGNAL_ARGS)
|
946 | 946 | if (ImmediateInterruptOK && InterruptHoldoffCount == 0 &&
|
947 | 947 | CritSectionCount == 0)
|
948 | 948 | {
|
| 949 | + /* bump holdoff count to make ProcessInterrupts() a no-op */ |
| 950 | + /* until we are done getting ready for it */ |
| 951 | + InterruptHoldoffCount++; |
949 | 952 | DisableNotifyInterrupt();
|
950 | 953 | /* Make sure HandleDeadLock won't run while shutting down... */
|
951 | 954 | LockWaitCancel();
|
| 955 | + InterruptHoldoffCount--; |
952 | 956 | ProcessInterrupts();
|
953 | 957 | }
|
954 | 958 | }
|
@@ -976,10 +980,19 @@ QueryCancelHandler(SIGNAL_ARGS)
|
976 | 980 | * if we're waiting for input, however.
|
977 | 981 | */
|
978 | 982 | if (ImmediateInterruptOK && InterruptHoldoffCount == 0 &&
|
979 |
| - CritSectionCount == 0 && LockWaitCancel()) |
| 983 | + CritSectionCount == 0) |
980 | 984 | {
|
981 |
| - DisableNotifyInterrupt(); |
982 |
| - ProcessInterrupts(); |
| 985 | + /* bump holdoff count to make ProcessInterrupts() a no-op */ |
| 986 | + /* until we are done getting ready for it */ |
| 987 | + InterruptHoldoffCount++; |
| 988 | + if (LockWaitCancel()) |
| 989 | + { |
| 990 | + InterruptHoldoffCount--; |
| 991 | + DisableNotifyInterrupt(); |
| 992 | + ProcessInterrupts(); |
| 993 | + } |
| 994 | + else |
| 995 | + InterruptHoldoffCount--; |
983 | 996 | }
|
984 | 997 | }
|
985 | 998 |
|
@@ -1680,7 +1693,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
|
1680 | 1693 | if (!IsUnderPostmaster)
|
1681 | 1694 | {
|
1682 | 1695 | puts("\nPOSTGRES backend interactive interface ");
|
1683 |
| - puts("$Revision: 1.208 $ $Date: 2001/02/24 02:04:51 $\n"); |
| 1696 | + puts("$Revision: 1.209 $ $Date: 2001/03/09 06:36:32 $\n"); |
1684 | 1697 | }
|
1685 | 1698 |
|
1686 | 1699 | /*
|
|
0 commit comments