aboutsummaryrefslogtreecommitdiff
path: root/src/include/storage/lmgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/storage/lmgr.h')
-rw-r--r--src/include/storage/lmgr.h64
1 files changed, 24 insertions, 40 deletions
diff --git a/src/include/storage/lmgr.h b/src/include/storage/lmgr.h
index 4082811bcc8..a85ba1e8ff7 100644
--- a/src/include/storage/lmgr.h
+++ b/src/include/storage/lmgr.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lmgr.h,v 1.15 1998/09/01 04:38:23 momjian Exp $
+ * $Id: lmgr.h,v 1.16 1998/12/15 12:46:57 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -17,64 +17,48 @@
#include <utils/rel.h>
#include <catalog/catname.h>
-/*
- * This was moved from pladt.h for the new lock manager. Want to obsolete
- * all of the old code.
- */
+#define AccessShareLock 1 /* SELECT */
+#define RowShareLock 2 /* SELECT FOR UPDATE */
+#define RowExclusiveLock 3 /* INSERT, UPDATE, DELETE */
+#define ShareLock 4
+#define ShareRowExclusiveLock 5
+#define ExclusiveLock 6
+#define AccessExclusiveLock 7
+
+#define ExtendLock 8
+
+extern LOCKMETHOD LockTableId;
+
+
typedef struct LockRelId
{
Oid relId; /* a relation identifier */
Oid dbId; /* a database identifier */
} LockRelId;
-#ifdef LowLevelLocking
typedef struct LockInfoData
{
LockRelId lockRelId;
- bool lockHeld[MAX_LOCKMODES]; /* on table level */
} LockInfoData;
-#else
-typedef struct LockInfoData
-{
- LockRelId lockRelId;
-} LockInfoData;
-
-#endif
-
typedef LockInfoData *LockInfo;
#define LockInfoIsValid(lockinfo) PointerIsValid(lockinfo)
+extern LOCKMETHOD InitLockTable(void);
extern void RelationInitLockInfo(Relation relation);
-extern void RelationSetLockForDescriptorOpen(Relation relation);
-extern void RelationSetLockForRead(Relation relation);
-extern void RelationUnsetLockForRead(Relation relation);
-extern void RelationSetLockForWrite(Relation relation);
-extern void RelationUnsetLockForWrite(Relation relation);
-/* used in vaccum.c */
-extern void RelationSetLockForWritePage(Relation relation,
- ItemPointer itemPointer);
+extern void LockRelation(Relation relation, LOCKMODE lockmode);
+extern void UnlockRelation(Relation relation, LOCKMODE lockmode);
-/* used in nbtpage.c, hashpage.c */
-extern void RelationSetSingleWLockPage(Relation relation,
- ItemPointer itemPointer);
-extern void RelationUnsetSingleWLockPage(Relation relation,
- ItemPointer itemPointer);
-extern void RelationSetSingleRLockPage(Relation relation,
- ItemPointer itemPointer);
-extern void RelationUnsetSingleRLockPage(Relation relation,
- ItemPointer itemPointer);
-extern void RelationSetRIntentLock(Relation relation);
-extern void RelationUnsetRIntentLock(Relation relation);
-extern void RelationSetWIntentLock(Relation relation);
-extern void RelationUnsetWIntentLock(Relation relation);
+/* this is for indices */
+extern void LockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);
+extern void UnlockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);
-/* single.c */
-extern bool SingleLockReln(LockInfo lockinfo, LOCKMODE lockmode, int action);
-extern bool SingleLockPage(LockInfo lockinfo, ItemPointer tidPtr,
- LOCKMODE lockmode, int action);
+/* and this is for transactions */
+extern void XactLockTableInsert(TransactionId xid);
+extern void XactLockTableDelete(TransactionId xid);
+extern void XactLockTableWait(TransactionId xid);
/* proc.c */
extern void InitProcGlobal(IPCKey key);