1
/*-------------------------------------------------------------------------
4
* Lightweight lock manager
7
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
10
* $PostgreSQL: pgsql/src/include/storage/lwlock.h,v 1.16 2004-12-31 22:03:42 pgsql Exp $
12
*-------------------------------------------------------------------------
18
* We have a number of predefined LWLocks, plus a bunch of LWLocks that are
19
* dynamically assigned (for shared buffers). The LWLock structures live
20
* in shared memory (since they contain shared data) and are identified by
21
* values of this enumerated type. We abuse the notion of an enum somewhat
22
* by allowing values not listed in the enum declaration to be assigned.
23
* The extra value MaxDynamicLWLock is there to keep the compiler from
24
* deciding that the enum can be represented as char or short ...
45
NumFixedLWLocks, /* must be last except for
48
MaxDynamicLWLock = 1000000000
52
typedef enum LWLockMode
60
extern bool Trace_lwlocks;
63
extern LWLockId LWLockAssign(void);
64
extern void LWLockAcquire(LWLockId lockid, LWLockMode mode);
65
extern bool LWLockConditionalAcquire(LWLockId lockid, LWLockMode mode);
66
extern void LWLockRelease(LWLockId lockid);
67
extern void LWLockReleaseAll(void);
68
extern bool LWLockHeldByMe(LWLockId lockid);
70
extern int NumLWLocks(void);
71
extern int LWLockShmemSize(void);
72
extern void CreateLWLocks(void);