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

Commit5099e8e

Browse files
committed
Silence compiler warnings
Rearrange a bit of code to ensure that 'mode' in LWLockRelease isobviously always set, which seems a bit cleaner and avoids a compilerwarning (thanks to Robert for the suggestion!).Back-patch back to 9.5 where the warning is first seen.Author: Stephen FrostDiscussion:https://postgr.es/m/20161129152102.GR13284%40tamriel.snowman.net
1 parent7911e78 commit5099e8e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,15 +1781,14 @@ LWLockRelease(LWLock *lock)
17811781
* be the latest-acquired lock; so search array backwards.
17821782
*/
17831783
for (i=num_held_lwlocks;--i >=0;)
1784-
{
17851784
if (lock==held_lwlocks[i].lock)
1786-
{
1787-
mode=held_lwlocks[i].mode;
17881785
break;
1789-
}
1790-
}
1786+
17911787
if (i<0)
17921788
elog(ERROR,"lock %s %d is not held",T_NAME(lock),T_ID(lock));
1789+
1790+
mode=held_lwlocks[i].mode;
1791+
17931792
num_held_lwlocks--;
17941793
for (;i<num_held_lwlocks;i++)
17951794
held_lwlocks[i]=held_lwlocks[i+1];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp