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-2017, 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 /*
19  * A node in a list of processes.
20  */
21 typedef struct proclist_node
22 {
23 	int			next;			/* pgprocno of the next PGPROC */
24 	int			prev;			/* pgprocno of the prev PGPROC */
25 } proclist_node;
26 
27 /*
28  * Head of a doubly-linked list of PGPROCs, identified by pgprocno.
29  */
30 typedef struct proclist_head
31 {
32 	int			head;			/* pgprocno of the head PGPROC */
33 	int			tail;			/* pgprocno of the tail PGPROC */
34 } proclist_head;
35 
36 /*
37  * List iterator allowing some modifications while iterating.
38  */
39 typedef struct proclist_mutable_iter
40 {
41 	int			cur;			/* pgprocno of the current PGPROC */
42 	int			next;			/* pgprocno of the next PGPROC */
43 } proclist_mutable_iter;
44 
45 #endif
46