19#ifndef PROVSQL_SHMEM_H
20#define PROVSQL_SHMEM_H
24#include "storage/ipc.h"
25#include "storage/lwlock.h"
31#if (PG_VERSION_NUM >= 150000) || defined(DOXYGEN)
76#ifdef PROVSQL_INPROCESS_STORE
86typedef struct provsql_fifo
95bool provsql_fifo_push(provsql_fifo *f,
const void *src,
size_t n);
97bool provsql_fifo_pop(provsql_fifo *f,
void *dst,
size_t n);
108void provsql_inproc_init(
void);
Build-configuration switches shared across the C and C++ sources.
provsqlSharedState * provsql_shared_state
Pointer to the ProvSQL shared-memory segment (set in provsql_shmem_startup).
shmem_startup_hook_type prev_shmem_startup
Saved pointer to the previous shmem_startup_hook, for chaining.
void provsql_shmem_unlock(void)
Release the ProvSQL LWLock.
void provsql_shmem_lock_exclusive(void)
Acquire the ProvSQL LWLock in exclusive mode.
void provsql_shmem_request(void)
Request shared memory from PostgreSQL (PG ≥ 15).
void provsql_shmem_startup(void)
Initialise the ProvSQL shared-memory segment.
Size provsql_memsize(void)
Return the number of bytes required for the shared-memory segment.
shmem_request_hook_type prev_shmem_request
Saved pointer to the previous shmem_request_hook (PG ≥ 15), for chaining.
void provsql_shmem_lock_shared(void)
Acquire the ProvSQL LWLock in shared mode.
Shared state stored in the PostgreSQL shared-memory segment.
long pipebmr
Background-to-main pipe: read end (worker reads).
LWLock * lock
Mutual-exclusion lock for pipe writes.
long pipembr
Main-to-background pipe: read end (worker reads).
long pipebmw
Background-to-main pipe: write end (worker writes).
long pipembw
Main-to-background pipe: write end (backend writes).
char kcmcp_endpoint[256]
Live endpoint of the managed KCMCP server ("" when none): written by the supervisor worker,...