|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.24 1998/01/2802:29:27 momjian Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.25 1998/01/2806:52:58 momjian Exp $ |
11 | 11 | *
|
12 | 12 | * NOTES
|
13 | 13 | * Outside modules can create a lock table and acquire/release
|
@@ -1456,13 +1456,14 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
|
1456 | 1456 | item.tag.pid=pid;
|
1457 | 1457 | #endif
|
1458 | 1458 |
|
1459 |
| -if ((result= (XIDLookupEnt*) |
1460 |
| -hash_search(xidTable, (Pointer)&item,HASH_FIND,&found))&&found) |
1461 |
| -MyNHolding=result->nHolding; |
1462 |
| -else |
1463 |
| -MyNHolding=0; |
1464 |
| -} |
1465 |
| - |
| 1459 | +if (!(result= (XIDLookupEnt*) |
| 1460 | +hash_search(xidTable, (Pointer)&item,HASH_FIND,&found))|| !found) |
| 1461 | +{ |
| 1462 | +elog(NOTICE,"LockAcquire: xid table corrupted"); |
| 1463 | +return true; |
| 1464 | +} |
| 1465 | +MyNHolding=result->nHolding; |
| 1466 | +} |
1466 | 1467 | if (SHMQueueEmpty(lockQueue))
|
1467 | 1468 | return false;
|
1468 | 1469 |
|
@@ -1533,12 +1534,14 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
|
1533 | 1534 | item.tag.pid=pid;
|
1534 | 1535 | #endif
|
1535 | 1536 |
|
1536 |
| -if ((result= (XIDLookupEnt*) |
1537 |
| -hash_search(xidTable, (Pointer)&item,HASH_FIND,&found))&&found) |
| 1537 | +if (!(result= (XIDLookupEnt*) |
| 1538 | +hash_search(xidTable, (Pointer)&item,HASH_FIND,&found))|| !found) |
1538 | 1539 | {
|
1539 |
| -if (result->nHolding) |
1540 |
| -return true; |
| 1540 | +elog(NOTICE,"LockAcquire: xid table corrupted"); |
| 1541 | +return true; |
1541 | 1542 | }
|
| 1543 | +if (result->nHolding) |
| 1544 | +return true; |
1542 | 1545 | }
|
1543 | 1546 | /*
|
1544 | 1547 | *No sense in looking at the wait queue of the lock we are
|
|