1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Refactor lock manager initialization to make it a bit less special

Split the shared and local initialization to separate functions, and
follow the common naming conventions. With this, we no longer create
the LockMethodLocalHash hash table in the postmaster process, which
was always pointless.

Reviewed-by: Andreas Karlsson
Discussion: https://www.postgresql.org/message-id/c09694ff-2453-47e5-b26c-32a16cd75ce6@iki.fi
This commit is contained in:
Heikki Linnakangas
2024-08-29 09:46:06 +03:00
parent 9f87da1cff
commit fbce7dfc77
4 changed files with 25 additions and 22 deletions

View File

@@ -544,7 +544,9 @@ typedef enum
/*
* function prototypes
*/
extern void InitLocks(void);
extern void LockManagerShmemInit(void);
extern Size LockManagerShmemSize(void);
extern void InitLockManagerAccess(void);
extern LockMethod GetLocksMethodTable(const LOCK *lock);
extern LockMethod GetLockTagsMethodTable(const LOCKTAG *locktag);
extern uint32 LockTagHashCode(const LOCKTAG *locktag);
@@ -584,7 +586,6 @@ extern bool LockCheckConflicts(LockMethod lockMethodTable,
extern void GrantLock(LOCK *lock, PROCLOCK *proclock, LOCKMODE lockmode);
extern void GrantAwaitedLock(void);
extern void RemoveFromWaitQueue(PGPROC *proc, uint32 hashcode);
extern Size LockShmemSize(void);
extern LockData *GetLockStatusData(void);
extern BlockedProcsData *GetBlockerStatusData(int blocked_pid);