1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-29 22:49:41 +03:00

[ Newest version of patch applied.]

This patch is an updated version of the lock listing patch. I've made
the following changes:

    - write documentation
    - wrap the SRF in a view called 'pg_locks': all user-level
      access should be done through this view
    - re-diff against latest CVS

One thing I chose not to do is adapt the SRF to use the anonymous
composite type code from Joe Conway. I'll probably do that eventually,
but I'm not really convinced it's a significantly cleaner way to
bootstrap SRF builtins than the method this patch uses (of course, it
has other uses...)

Neil Conway
This commit is contained in:
Bruce Momjian
2002-08-17 13:04:19 +00:00
parent f0ed4311b6
commit 82119a696e
11 changed files with 248 additions and 20 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: lock.h,v 1.64 2002/08/01 05:18:34 momjian Exp $
* $Id: lock.h,v 1.65 2002/08/17 13:04:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -203,6 +203,21 @@ typedef struct PROCLOCK
#define PROCLOCK_LOCKMETHOD(holder) \
(((LOCK *) MAKE_PTR((holder).tag.lock))->tag.lockmethod)
/*
* This struct is used to encapsulate information passed from lmgr
* internals to the lock listing statistical functions (lockfuncs.c).
* It's just a convenient bundle of other lock.h structures. All
* the information at a given index (holders[i], procs[i], locks[i])
* is related.
*/
typedef struct
{
int nelements; /* The length of holders, procs, & locks */
int currIdx; /* Current element being examined */
PGPROC *procs;
LOCK *locks;
PROCLOCK *holders;
} LockData;
/*
* function prototypes
@@ -227,6 +242,8 @@ extern void RemoveFromWaitQueue(PGPROC *proc);
extern int LockShmemSize(int maxBackends);
extern bool DeadLockCheck(PGPROC *proc);
extern void InitDeadLockChecking(void);
extern void GetLockStatusData(LockData *data);
extern char *GetLockmodeName(LOCKMODE mode);
#ifdef LOCK_DEBUG
extern void DumpLocks(void);