Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ff43ba

Browse files
committed
Lock cleanup
1 parent8a02b22 commit0ff43ba

File tree

1 file changed

+15
-12
lines changed
  • src/backend/storage/lmgr

1 file changed

+15
-12
lines changed

‎src/backend/storage/lmgr/lock.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* 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 $
1111
*
1212
* NOTES
1313
* Outside modules can create a lock table and acquire/release
@@ -1456,13 +1456,14 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
14561456
item.tag.pid=pid;
14571457
#endif
14581458

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+
}
14661467
if (SHMQueueEmpty(lockQueue))
14671468
return false;
14681469

@@ -1533,12 +1534,14 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
15331534
item.tag.pid=pid;
15341535
#endif
15351536

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)
15381539
{
1539-
if (result->nHolding)
1540-
return true;
1540+
elog(NOTICE,"LockAcquire: xid table corrupted");
1541+
return true;
15411542
}
1543+
if (result->nHolding)
1544+
return true;
15421545
}
15431546
/*
15441547
*No sense in looking at the wait queue of the lock we are

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp