8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
48
48
* This is so that we can support more backends. (system-wide semaphore
49
49
* sets run out pretty fast.) -ay 4/95
50
50
*
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 $
52
52
*/
53
53
#include "postgres.h"
54
54
@@ -864,7 +864,9 @@ HandleDeadLock(SIGNAL_ARGS)
864
864
{
865
865
int save_errno = errno ;
866
866
LOCK * mywaitlock ;
867
+ bool isWaitingForLock = lockWaiting ; /* save waiting status */
867
868
869
+ SetWaitingForLock (false); /* disable query cancel during this fuction */
868
870
LockLockTable ();
869
871
870
872
/* ---------------------
@@ -884,6 +886,7 @@ HandleDeadLock(SIGNAL_ARGS)
884
886
{
885
887
UnlockLockTable ();
886
888
errno = save_errno ;
889
+ SetWaitingForLock (isWaitingForLock ); /* restore waiting status */
887
890
return ;
888
891
}
889
892
@@ -897,6 +900,7 @@ HandleDeadLock(SIGNAL_ARGS)
897
900
/* No deadlock, so keep waiting */
898
901
UnlockLockTable ();
899
902
errno = save_errno ;
903
+ SetWaitingForLock (isWaitingForLock ); /* restore waiting status */
900
904
return ;
901
905
}
902
906
@@ -911,7 +915,7 @@ HandleDeadLock(SIGNAL_ARGS)
911
915
SHMQueueElemInit (& (MyProc -> links ));
912
916
MyProc -> waitLock = NULL ;
913
917
MyProc -> waitHolder = NULL ;
914
- lockWaiting = false;
918
+ isWaitingForLock = false; /* wait for lock no longer */
915
919
916
920
/* ------------------
917
921
* Unlock my semaphore so that the interrupted ProcSleep() call can finish.
0 commit comments