88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.89 2000/12/22 00:51:54 tgl Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.90 2001/01/09 09:38:57 inoue Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
4848 * This is so that we can support more backends. (system-wide semaphore
4949 * sets run out pretty fast.) -ay 4/95
5050 *
51- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.89 2000/12/22 00:51:54 tgl Exp $
51+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.90 2001/01/09 09:38:57 inoue Exp $
5252 */
5353#include "postgres.h"
5454
@@ -864,7 +864,9 @@ HandleDeadLock(SIGNAL_ARGS)
864864{
865865 int save_errno = errno ;
866866 LOCK * mywaitlock ;
867+ bool isWaitingForLock = lockWaiting ; /* save waiting status */
867868
869+ SetWaitingForLock (false); /* disable query cancel during this fuction */
868870 LockLockTable ();
869871
870872 /* ---------------------
@@ -884,6 +886,7 @@ HandleDeadLock(SIGNAL_ARGS)
884886 {
885887 UnlockLockTable ();
886888 errno = save_errno ;
889+ SetWaitingForLock (isWaitingForLock ); /* restore waiting status */
887890 return ;
888891 }
889892
@@ -897,6 +900,7 @@ HandleDeadLock(SIGNAL_ARGS)
897900 /* No deadlock, so keep waiting */
898901 UnlockLockTable ();
899902 errno = save_errno ;
903+ SetWaitingForLock (isWaitingForLock ); /* restore waiting status */
900904 return ;
901905 }
902906
@@ -911,7 +915,7 @@ HandleDeadLock(SIGNAL_ARGS)
911915 SHMQueueElemInit (& (MyProc -> links ));
912916 MyProc -> waitLock = NULL ;
913917 MyProc -> waitHolder = NULL ;
914- lockWaiting = false;
918+ isWaitingForLock = false; /* wait for lock no longer */
915919
916920 /* ------------------
917921 * Unlock my semaphore so that the interrupted ProcSleep() call can finish.
0 commit comments