提交 06c120e6 编写于 作者: B Bruce Momjian

Update for deadlock timer.

上级 2b8736ba
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.45 1998/12/29 18:29:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.46 1998/12/29 18:36:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore * This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95 * sets run out pretty fast.) -ay 4/95
* *
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.45 1998/12/29 18:29:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.46 1998/12/29 18:36:29 momjian Exp $
*/ */
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
...@@ -520,20 +520,19 @@ ProcSleep(PROC_QUEUE *waitQueue,/* lock->waitProcs */ ...@@ -520,20 +520,19 @@ ProcSleep(PROC_QUEUE *waitQueue,/* lock->waitProcs */
do do
{ {
int expired;
MyProc->errType = NO_ERROR; /* reset flag after deadlock check */ MyProc->errType = NO_ERROR; /* reset flag after deadlock check */
if (deadlock_checked == false) if (deadlock_checked == false)
expired = sleep(DeadlockCheckTimer ? DeadlockCheckTimer : DEADLOCK_CHECK_TIMER);
else
pause();
if (expired == 0 && deadlock_checked == false)
{ {
HandleDeadLock(); if (sleep(DeadlockCheckTimer ? DeadlockCheckTimer : DEADLOCK_CHECK_TIMER)
deadlock_checked = true; == 0 /* no signal interruption */ )
{
HandleDeadLock();
deadlock_checked = true;
}
} }
else
pause();
/* -------------- /* --------------
* if someone wakes us between SpinRelease and IpcSemaphoreLock, * if someone wakes us between SpinRelease and IpcSemaphoreLock,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册