Neil Conway wrote:
> + /*
> +  * The following need to be available to the read/write_backend_variables
> +  * functions
> +  */
> + extern XLogRecPtr RedoRecPtr;
> + extern XLogwrtResult LogwrtResult;
> + extern slock_t *ShmemLock;
> + extern slock_t *ShmemIndexLock;
> + extern void *ShmemIndexAlloc;
> + typedef struct LWLock LWLock;
> + extern LWLock *LWLockArray;
> + extern slock_t  *ProcStructLock;
> + extern int  pgStatSock;
> 
> I wonder whether it is cleaner to make these properly public, rather
> than using the NON_EXEC_STATIC #ifdef... (I'm not necessarily saying
> it is, I'm just tossing it out there).

This was my idea.  Rather than making statics as globals, they are
global only for exec() builds.  This seemed safest.  They need to be
extern for exec() because we need to reference them in a function that
writes all the postmaster globals to a file.  We could have had a write
function in every C file that needed it and call the write function from
postmaster.c, but that seems like too much bloat.  If we make them
extern in all builds we lose the safety of a static.

Your other comments are good and I will wait for Claudio to respond.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to