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

Commit98347b5

Browse files
committed
Lift limitation that PGPROC->links must be the first field
Since commit5764f61, we've been using the ilist.h functions forhandling the linked list. There's no need for 'links' to be the firstelement of the struct anymore, except for one call in InitProcesswhere we used a straight cast from the 'dlist_node *' to PGPROC *,without the dlist_container() macro. That was just an oversight incommit5764f61, fix it.There no imminent need to move 'links' from being the first field, butlet's be tidy.Reviewed-by: Aleksander Alekseev, Andres FreundDiscussion:https://www.postgresql.org/message-id/22aa749e-cc1a-424a-b455-21325473a794@iki.fi
1 parent590b045 commit98347b5

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ InitProcess(void)
330330

331331
if (!dlist_is_empty(procgloballist))
332332
{
333-
MyProc= (PGPROC*)dlist_pop_head_node(procgloballist);
333+
MyProc=dlist_container(PGPROC,links,dlist_pop_head_node(procgloballist));
334334
SpinLockRelease(ProcStructLock);
335335
}
336336
else

‎src/include/storage/proc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ typedef enum
161161
*/
162162
structPGPROC
163163
{
164-
/* proc->links MUST BE FIRST IN STRUCT (see ProcSleep,ProcWakeup,etc) */
165164
dlist_nodelinks;/* list link if process is in a list */
166165
dlist_head*procgloballist;/* procglobal list that owns this PGPROC */
167166

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp