summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/config.h.in16
-rw-r--r--src/include/storage/lock.h4
2 files changed, 11 insertions, 9 deletions
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 74f84894db7..9c0b1829c1f 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -210,14 +210,16 @@ extern void srandom(int seed);
code seems broken without it, Bruce Momjian */
/* #define LOARRAY */
-/* This is the time, in seconds, at which a given backend server
- * will wait on a lock before deciding to abort the transaction
- * (this is what we do in lieu of deadlock detection).
- *
- * Low numbers are not recommended as they will tend to cause
- * false aborts if many transactions are long-lived.
+/*
+ * As soon as the backend blocks on a lock, it waits this number of seconds
+ * before checking for a deadlock. If not, it keeps checking every this
+ * number of seconds.
+ * We don't check for deadlocks just before sleeping because a deadlock is
+ * a rare event, and checking is an expensive operation.
+ * We only detect deadlocks between two processes, not three or more, but
+ * these are the most common.
*/
-#define DEADLOCK_TIMEOUT 60
+#define DEADLOCK_CHECK_TIMER 60
/*
* This flag enables the use of idexes in plans generated for function
diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h
index e2a45e91203..98804eb1f08 100644
--- a/src/include/storage/lock.h
+++ b/src/include/storage/lock.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lock.h,v 1.9 1998/01/24 22:50:11 momjian Exp $
+ * $Id: lock.h,v 1.10 1998/01/27 03:00:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -214,7 +214,7 @@ extern void GrantLock(LOCK *lock, LOCKT lockt);
extern bool LockReleaseAll(LockTableId tableId, SHM_QUEUE *lockQueue);
extern int LockShmemSize(void);
extern bool LockingDisabled(void);
-
+extern bool DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check);
#ifdef DEADLOCK_DEBUG
extern void DumpLocks(void);