postgresql/src/include/postmaster
Peter Eisentraut 8f8bcb8883 Improve some global variable declarations
We have in launch_backend.c:

    /*
     * The following need to be available to the save/restore_backend_variables
     * functions.  They are marked NON_EXEC_STATIC in their home modules.
     */
    extern slock_t *ShmemLock;
    extern slock_t *ProcStructLock;
    extern PGPROC *AuxiliaryProcs;
    extern PMSignalData *PMSignalState;
    extern pg_time_t first_syslogger_file_time;
    extern struct bkend *ShmemBackendArray;
    extern bool redirection_done;

That comment is not completely true: ShmemLock, ShmemBackendArray, and
redirection_done are not in fact NON_EXEC_STATIC.  ShmemLock once was,
but was then needed elsewhere.  ShmemBackendArray was static inside
postmaster.c before launch_backend.c was created.  redirection_done
was never static.

This patch moves the declaration of ShmemLock and redirection_done to
a header file.

ShmemBackendArray gets a NON_EXEC_STATIC.  This doesn't make a
difference, since it only exists if EXEC_BACKEND anyway, but it makes
it consistent.

After that, the comment is now correct.

Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
2024-07-02 07:26:22 +02:00
..
autovacuum.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
auxprocess.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
bgworker.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
bgworker_internals.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
bgwriter.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
fork_process.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
interrupt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgarch.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
postmaster.h Improve some global variable declarations 2024-07-02 07:26:22 +02:00
startup.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
syslogger.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
walsummarizer.h Prevent summarizer hang when summarize_wal turned off and back on. 2024-06-28 08:29:05 -04:00
walwriter.h Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00