diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-08-15 18:09:55 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-08-15 18:09:55 -0400 |
commit | b25b6c9701e5c18e3ad3b701df62380f8d138ba0 (patch) | |
tree | 36b2b548161aad15d859494b034d5a0b7dd36f02 /src/include/storage/proc.h | |
parent | 2bf06f756142f4c398270cdc30bbba9b9dfbd38b (diff) | |
download | postgresql-b25b6c9701e5c18e3ad3b701df62380f8d138ba0.tar.gz postgresql-b25b6c9701e5c18e3ad3b701df62380f8d138ba0.zip |
Once again allow LWLocks to be used within DSM segments.
Prior to commit 7882c3b0b95640e361f1533fe0f2d02e4e5d8610, it was
possible to use LWLocks within DSM segments, but that commit broke
this use case by switching from a doubly linked list to a circular
linked list. Switch back, using a new bit of general infrastructure
for maintaining lists of PGPROCs.
Thomas Munro, reviewed by me.
Diffstat (limited to 'src/include/storage/proc.h')
-rw-r--r-- | src/include/storage/proc.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 775c66a1971..f576f052dfe 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -19,6 +19,7 @@ #include "storage/latch.h" #include "storage/lock.h" #include "storage/pg_sema.h" +#include "storage/proclist_types.h" /* * Each backend advertises up to PGPROC_MAX_CACHED_SUBXIDS TransactionIds @@ -112,7 +113,7 @@ struct PGPROC /* Info about LWLock the process is currently waiting for, if any. */ bool lwWaiting; /* true if waiting for an LW lock */ uint8 lwWaitMode; /* lwlock mode being waited for */ - dlist_node lwWaitLink; /* position in LW lock wait list */ + proclist_node lwWaitLink; /* position in LW lock wait list */ /* Info about lock the process is currently waiting for, if any. */ /* waitLock and waitProcLock are NULL if not currently waiting. */ @@ -243,6 +244,9 @@ extern PROC_HDR *ProcGlobal; extern PGPROC *PreparedXactProcs; +/* Accessor for PGPROC given a pgprocno. */ +#define GetPGProcByNumber(n) (&ProcGlobal->allProcs[(n)]) + /* * We set aside some extra PGPROC structures for auxiliary processes, * ie things that aren't full-fledged backends but need shmem access. |