diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-16 20:59:34 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-16 20:59:34 +0000 |
commit | dae52bf3ec7d979f96ee77141daa73081a7546a9 (patch) | |
tree | 4a944ac0b8960eb219608bcc4b2fe4f07b8833b1 /src/backend/tcop/postgres.c | |
parent | 64e6c60897373399b08efff5d665b3b5417d6c79 (diff) | |
download | postgresql-dae52bf3ec7d979f96ee77141daa73081a7546a9.tar.gz postgresql-dae52bf3ec7d979f96ee77141daa73081a7546a9.zip |
Oops, I had managed to break query-cancel-while-waiting-for-lock.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index ff2c0c283d2..80a1032e9a9 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.201 2001/01/14 05:08:16 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.202 2001/01/16 20:59:34 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -940,11 +940,14 @@ die(SIGNAL_ARGS) InterruptPending = true; ProcDiePending = true; /* - * If we're waiting for input, service the interrupt immediately + * If it's safe to interrupt, and we're waiting for input or a lock, + * service the interrupt immediately */ if (ImmediateInterruptOK && CritSectionCount == 0) { DisableNotifyInterrupt(); + /* Make sure HandleDeadLock won't run while shutting down... */ + LockWaitCancel(); ProcessInterrupts(); } } @@ -967,8 +970,16 @@ QueryCancelHandler(SIGNAL_ARGS) InterruptPending = true; QueryCancelPending = true; /* - * No point in raising Cancel if we are waiting for input ... + * If it's safe to interrupt, and we're waiting for a lock, + * service the interrupt immediately. No point in interrupting + * if we're waiting for input, however. */ + if (ImmediateInterruptOK && CritSectionCount == 0 && + LockWaitCancel()) + { + DisableNotifyInterrupt(); + ProcessInterrupts(); + } } errno = save_errno; @@ -1668,7 +1679,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.201 $ $Date: 2001/01/14 05:08:16 $\n"); + puts("$Revision: 1.202 $ $Date: 2001/01/16 20:59:34 $\n"); } /* |