19#include "storage/shmem.h"
25#if (PG_VERSION_NUM >= 150000)
43 LWLockAcquire(AddinShmemInitLock, LW_EXCLUSIVE);
54 LWLockRelease(AddinShmemInitLock);
60 if(pipe(pipes_b_to_m) || pipe(pipes_m_to_b))
61 provsql_error(
"Cannot create pipe to communicate with MMap worker");
76#if (PG_VERSION_NUM >= 150000)
83 RequestNamedLWLockTranche(
"provsql", 1);
#define provsql_error(fmt,...)
Report a fatal ProvSQL error and abort the current transaction.
Background worker and IPC primitives for mmap-backed circuit storage.
void provsql_shmem_unlock(void)
Release the ProvSQL LWLock.
void provsql_shmem_lock_exclusive(void)
Acquire the ProvSQL LWLock in exclusive mode.
provsqlSharedState * provsql_shared_state
Pointer to the ProvSQL shared-memory segment (set in provsql_shmem_startup).
void provsql_shmem_request(void)
Request shared memory from PostgreSQL (PG ≥ 15).
shmem_startup_hook_type prev_shmem_startup
Saved pointer to the previous shmem_startup_hook, for chaining.
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.
void provsql_shmem_lock_shared(void)
Acquire the ProvSQL LWLock in shared mode.
Shared-memory segment and inter-process pipe management.
shmem_request_hook_type prev_shmem_request
Saved pointer to the previous shmem_request_hook (PG ≥ 15), for chaining.
Shared state stored in the PostgreSQL shared-memory segment.