Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8fff96f

Browse files
author
Hiroshi Inoue
committed
hold interupts during LockWaitCancel().
1 parent131e85d commit8fff96f

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* 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 $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -946,9 +946,13 @@ die(SIGNAL_ARGS)
946946
if (ImmediateInterruptOK&&InterruptHoldoffCount==0&&
947947
CritSectionCount==0)
948948
{
949+
/* bump holdoff count to make ProcessInterrupts() a no-op */
950+
/* until we are done getting ready for it */
951+
InterruptHoldoffCount++;
949952
DisableNotifyInterrupt();
950953
/* Make sure HandleDeadLock won't run while shutting down... */
951954
LockWaitCancel();
955+
InterruptHoldoffCount--;
952956
ProcessInterrupts();
953957
}
954958
}
@@ -976,10 +980,19 @@ QueryCancelHandler(SIGNAL_ARGS)
976980
* if we're waiting for input, however.
977981
*/
978982
if (ImmediateInterruptOK&&InterruptHoldoffCount==0&&
979-
CritSectionCount==0&&LockWaitCancel())
983+
CritSectionCount==0)
980984
{
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--;
983996
}
984997
}
985998

@@ -1680,7 +1693,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
16801693
if (!IsUnderPostmaster)
16811694
{
16821695
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");
16841697
}
16851698

16861699
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp