summaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
-rw-r--r--src/backend/storage/lmgr/proc.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index a58b355ecf2..bc461f0f86f 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.93 2001/01/16 06:11:34 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.94 2001/01/16 20:59:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,7 +48,7 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.93 2001/01/16 06:11:34 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.94 2001/01/16 20:59:34 tgl Exp $
*/
#include "postgres.h"
@@ -353,16 +353,19 @@ RemoveFromWaitQueue(PROC *proc)
/*
* Cancel any pending wait for lock, when aborting a transaction.
*
+ * Returns true if we had been waiting for a lock, else false.
+ *
* (Normally, this would only happen if we accept a cancel/die
* interrupt while waiting; but an elog(ERROR) while waiting is
* within the realm of possibility, too.)
*/
-void
+bool
LockWaitCancel(void)
{
/* Nothing to do if we weren't waiting for a lock */
if (!waitingForLock)
- return;
+ return false;
+
waitingForLock = false;
/* Turn off the deadlock timer, if it's still running (see ProcSleep) */
@@ -395,6 +398,12 @@ LockWaitCancel(void)
* prematurely.
*/
ZeroProcSemaphore(MyProc);
+
+ /*
+ * Return true even if we were kicked off the lock before we were
+ * able to remove ourselves.
+ */
+ return true;
}