summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Inoue2001-01-09 09:38:57 +0000
committerHiroshi Inoue2001-01-09 09:38:57 +0000
commit7edb4442aae0261aa5d17943a96f3d09345209ed (patch)
tree54c34c9f9c309d51a5989dd6efb6e57919b1b886
parente2a21827d4241009ae2a73069d6d50f590a48745 (diff)
Disable query cancel during HandleDeadLock().
-rw-r--r--src/backend/storage/lmgr/proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 8229dc242f..34db174a04 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -864,7 +864,9 @@ HandleDeadLock(SIGNAL_ARGS)
{
int save_errno = errno;
LOCK *mywaitlock;
+ bool isWaitingForLock = lockWaiting; /* save waiting status */
+ SetWaitingForLock(false); /* disable query cancel during this fuction */
LockLockTable();
/* ---------------------
@@ -884,6 +886,7 @@ HandleDeadLock(SIGNAL_ARGS)
{
UnlockLockTable();
errno = save_errno;
+ SetWaitingForLock(isWaitingForLock); /* restore waiting status */
return;
}
@@ -897,6 +900,7 @@ HandleDeadLock(SIGNAL_ARGS)
/* No deadlock, so keep waiting */
UnlockLockTable();
errno = save_errno;
+ SetWaitingForLock(isWaitingForLock); /* restore waiting status */
return;
}
@@ -911,7 +915,7 @@ HandleDeadLock(SIGNAL_ARGS)
SHMQueueElemInit(&(MyProc->links));
MyProc->waitLock = NULL;
MyProc->waitHolder = NULL;
- lockWaiting = false;
+ isWaitingForLock = false; /* wait for lock no longer */
/* ------------------
* Unlock my semaphore so that the interrupted ProcSleep() call can finish.