Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef LMGR_H
00015 #define LMGR_H
00016
00017 #include "lib/stringinfo.h"
00018 #include "storage/itemptr.h"
00019 #include "storage/lock.h"
00020 #include "utils/rel.h"
00021
00022
00023 extern void RelationInitLockInfo(Relation relation);
00024
00025
00026 extern void LockRelationOid(Oid relid, LOCKMODE lockmode);
00027 extern bool ConditionalLockRelationOid(Oid relid, LOCKMODE lockmode);
00028 extern void UnlockRelationId(LockRelId *relid, LOCKMODE lockmode);
00029 extern void UnlockRelationOid(Oid relid, LOCKMODE lockmode);
00030
00031 extern void LockRelation(Relation relation, LOCKMODE lockmode);
00032 extern bool ConditionalLockRelation(Relation relation, LOCKMODE lockmode);
00033 extern void UnlockRelation(Relation relation, LOCKMODE lockmode);
00034 extern bool LockHasWaitersRelation(Relation relation, LOCKMODE lockmode);
00035
00036 extern void LockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode);
00037 extern void UnlockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode);
00038
00039
00040 extern void LockRelationForExtension(Relation relation, LOCKMODE lockmode);
00041 extern void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode);
00042
00043
00044 extern void LockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);
00045 extern bool ConditionalLockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);
00046 extern void UnlockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);
00047
00048
00049 extern void LockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode);
00050 extern bool ConditionalLockTuple(Relation relation, ItemPointer tid,
00051 LOCKMODE lockmode);
00052 extern void UnlockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode);
00053
00054
00055 extern void XactLockTableInsert(TransactionId xid);
00056 extern void XactLockTableDelete(TransactionId xid);
00057 extern void XactLockTableWait(TransactionId xid);
00058 extern bool ConditionalXactLockTableWait(TransactionId xid);
00059
00060
00061 extern void LockDatabaseObject(Oid classid, Oid objid, uint16 objsubid,
00062 LOCKMODE lockmode);
00063 extern void UnlockDatabaseObject(Oid classid, Oid objid, uint16 objsubid,
00064 LOCKMODE lockmode);
00065
00066
00067 extern void LockSharedObject(Oid classid, Oid objid, uint16 objsubid,
00068 LOCKMODE lockmode);
00069 extern void UnlockSharedObject(Oid classid, Oid objid, uint16 objsubid,
00070 LOCKMODE lockmode);
00071
00072 extern void LockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid,
00073 LOCKMODE lockmode);
00074 extern void UnlockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid,
00075 LOCKMODE lockmode);
00076
00077
00078 extern void DescribeLockTag(StringInfo buf, const LOCKTAG *tag);
00079
00080 #endif