18 #error "lwlock.h may not be included from frontend code"
22 #include "storage/lwlocknames.h"
62 #define LWLOCK_PADDED_SIZE PG_CACHE_LINE_SIZE
65 "Miscalculated LWLock padding");
93 #define NUM_BUFFER_PARTITIONS 128
96 #define LOG2_NUM_LOCK_PARTITIONS 4
97 #define NUM_LOCK_PARTITIONS (1 << LOG2_NUM_LOCK_PARTITIONS)
100 #define LOG2_NUM_PREDICATELOCK_PARTITIONS 4
101 #define NUM_PREDICATELOCK_PARTITIONS (1 << LOG2_NUM_PREDICATELOCK_PARTITIONS)
104 #define BUFFER_MAPPING_LWLOCK_OFFSET NUM_INDIVIDUAL_LWLOCKS
105 #define LOCK_MANAGER_LWLOCK_OFFSET \
106 (BUFFER_MAPPING_LWLOCK_OFFSET + NUM_BUFFER_PARTITIONS)
107 #define PREDICATELOCK_MANAGER_LWLOCK_OFFSET \
108 (LOCK_MANAGER_LWLOCK_OFFSET + NUM_LOCK_PARTITIONS)
109 #define NUM_FIXED_LWLOCKS \
110 (PREDICATELOCK_MANAGER_LWLOCK_OFFSET + NUM_PREDICATELOCK_PARTITIONS)
void LWLockUpdateVar(LWLock *lock, pg_atomic_uint64 *valptr, uint64 val)
union LWLockPadded LWLockPadded
bool LWLockHeldByMe(LWLock *lock)
const char * GetLWLockIdentifier(uint32 classId, uint16 eventId)
LWLockPadded * GetNamedLWLockTranche(const char *tranche_name)
void LWLockReleaseClearVar(LWLock *lock, pg_atomic_uint64 *valptr, uint64 val)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
PGDLLIMPORT NamedLWLockTranche * NamedLWLockTrancheArray
struct NamedLWLockTranche NamedLWLockTranche
#define LWLOCK_PADDED_SIZE
void LWLockRegisterTranche(int tranche_id, const char *tranche_name)
bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode)
PGDLLIMPORT int NamedLWLockTrancheRequests
bool LWLockWaitForVar(LWLock *lock, pg_atomic_uint64 *valptr, uint64 oldval, uint64 *newval)
int LWLockNewTrancheId(void)
void RequestNamedLWLockTranche(const char *tranche_name, int num_lwlocks)
void LWLockRelease(LWLock *lock)
@ LWTRANCHE_FIRST_USER_DEFINED
@ LWTRANCHE_SHARED_TIDBITMAP
@ LWTRANCHE_PER_SESSION_DSA
@ LWTRANCHE_PARALLEL_QUERY_DSA
@ LWTRANCHE_COMMITTS_BUFFER
@ LWTRANCHE_PARALLEL_VACUUM_DSA
@ LWTRANCHE_SUBTRANS_BUFFER
@ LWTRANCHE_PER_SESSION_RECORD_TYPMOD
@ LWTRANCHE_LAUNCHER_HASH
@ LWTRANCHE_DSM_REGISTRY_DSA
@ LWTRANCHE_DSM_REGISTRY_HASH
@ LWTRANCHE_REPLICATION_ORIGIN_STATE
@ LWTRANCHE_MULTIXACTOFFSET_SLRU
@ LWTRANCHE_PARALLEL_APPEND
@ LWTRANCHE_REPLICATION_SLOT_IO
@ LWTRANCHE_SUBTRANS_SLRU
@ LWTRANCHE_MULTIXACTMEMBER_SLRU
@ LWTRANCHE_BUFFER_CONTENT
@ LWTRANCHE_MULTIXACTMEMBER_BUFFER
@ LWTRANCHE_NOTIFY_BUFFER
@ LWTRANCHE_PER_SESSION_RECORD_TYPE
@ LWTRANCHE_PREDICATE_LOCK_MANAGER
@ LWTRANCHE_BUFFER_MAPPING
@ LWTRANCHE_SERIAL_BUFFER
@ LWTRANCHE_PARALLEL_HASH_JOIN
@ LWTRANCHE_COMMITTS_SLRU
@ LWTRANCHE_PER_XACT_PREDICATE_LIST
@ LWTRANCHE_MULTIXACTOFFSET_BUFFER
@ LWTRANCHE_SHARED_TUPLESTORE
@ LWTRANCHE_LOCK_FASTPATH
void LWLockReleaseAll(void)
void LWLockInitialize(LWLock *lock, int tranche_id)
bool LWLockConditionalAcquire(LWLock *lock, LWLockMode mode)
bool LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
PGDLLIMPORT LWLockPadded * MainLWLockArray
StaticAssertDecl(sizeof(LWLock)<=LWLOCK_PADDED_SIZE, "Miscalculated LWLock padding")
Size LWLockShmemSize(void)
bool LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride)
void InitLWLockAccess(void)
static PgChecksumMode mode
char pad[LWLOCK_PADDED_SIZE]