Lock cleanup

This commit is contained in:
Bruce Momjian 1998-01-28 06:52:58 +00:00
parent 8a02b22e89
commit 0ff43badd5
1 changed files with 15 additions and 12 deletions

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.24 1998/01/28 02:29:27 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.25 1998/01/28 06:52:58 momjian Exp $
* *
* NOTES * NOTES
* Outside modules can create a lock table and acquire/release * Outside modules can create a lock table and acquire/release
@ -1456,13 +1456,14 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
item.tag.pid = pid; item.tag.pid = pid;
#endif #endif
if ((result = (XIDLookupEnt *) if (!(result = (XIDLookupEnt *)
hash_search(xidTable, (Pointer) &item, HASH_FIND, &found)) && found) hash_search(xidTable, (Pointer) &item, HASH_FIND, &found)) || !found)
MyNHolding = result->nHolding; {
else elog(NOTICE, "LockAcquire: xid table corrupted");
MyNHolding = 0; return true;
} }
MyNHolding = result->nHolding;
}
if (SHMQueueEmpty(lockQueue)) if (SHMQueueEmpty(lockQueue))
return false; return false;
@ -1533,12 +1534,14 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
item.tag.pid = pid; item.tag.pid = pid;
#endif #endif
if ((result = (XIDLookupEnt *) if (!(result = (XIDLookupEnt *)
hash_search(xidTable, (Pointer) &item, HASH_FIND, &found)) && found) hash_search(xidTable, (Pointer) &item, HASH_FIND, &found)) || !found)
{ {
if (result->nHolding) elog(NOTICE, "LockAcquire: xid table corrupted");
return true; return true;
} }
if (result->nHolding)
return true;
} }
/* /*
* No sense in looking at the wait queue of the lock we are * No sense in looking at the wait queue of the lock we are