PostgreSQL Source Code  git master
proclist_types.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * proclist_types.h
4  * doubly-linked lists of pgprocnos
5  *
6  * See proclist.h for functions that operate on these types.
7  *
8  * Portions Copyright (c) 2016-2024, PostgreSQL Global Development Group
9  *
10  * IDENTIFICATION
11  * src/include/storage/proclist_types.h
12  *-------------------------------------------------------------------------
13  */
14 
15 #ifndef PROCLIST_TYPES_H
16 #define PROCLIST_TYPES_H
17 
18 #include "storage/procnumber.h"
19 
20 /*
21  * A node in a doubly-linked list of processes. The link fields contain
22  * the 0-based PGPROC indexes of the next and previous process, or
23  * INVALID_PROC_NUMBER in the next-link of the last node and the prev-link
24  * of the first node. A node that is currently not in any list
25  * should have next == prev == 0; this is not a possible state for a node
26  * that is in a list, because we disallow circularity.
27  */
28 typedef struct proclist_node
29 {
30  ProcNumber next; /* pgprocno of the next PGPROC */
31  ProcNumber prev; /* pgprocno of the prev PGPROC */
33 
34 /*
35  * Header of a doubly-linked list of PGPROCs, identified by pgprocno.
36  * An empty list is represented by head == tail == INVALID_PROC_NUMBER.
37  */
38 typedef struct proclist_head
39 {
40  ProcNumber head; /* pgprocno of the head PGPROC */
41  ProcNumber tail; /* pgprocno of the tail PGPROC */
43 
44 /*
45  * List iterator allowing some modifications while iterating.
46  */
47 typedef struct proclist_mutable_iter
48 {
49  ProcNumber cur; /* pgprocno of the current PGPROC */
50  ProcNumber next; /* pgprocno of the next PGPROC */
52 
53 #endif /* PROCLIST_TYPES_H */
struct proclist_head proclist_head
struct proclist_node proclist_node
struct proclist_mutable_iter proclist_mutable_iter
int ProcNumber
Definition: procnumber.h:24
ProcNumber head
ProcNumber tail
ProcNumber prev
ProcNumber next