diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
commit | d31084e9d1118b25fd16580d9d8c2924b5740dff (patch) | |
tree | 3179e66307d54df9c7b966543550e601eb55e668 /src/backend/storage/multilev.h | |
download | postgresql-PG95-1_01.tar.gz postgresql-PG95-1_01.zip |
Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01
Diffstat (limited to 'src/backend/storage/multilev.h')
-rw-r--r-- | src/backend/storage/multilev.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/backend/storage/multilev.h b/src/backend/storage/multilev.h new file mode 100644 index 00000000000..582c1cb6c37 --- /dev/null +++ b/src/backend/storage/multilev.h @@ -0,0 +1,64 @@ +/*------------------------------------------------------------------------- + * + * multilev.h-- + * multi level lock table consts/defs for single.c and multi.c and their + * clients + * + * + * Copyright (c) 1994, Regents of the University of California + * + * $Id: multilev.h,v 1.1.1.1 1996/07/09 06:21:53 scrappy Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef MULTILEV_H +#define MULTILEV_H + +#include "storage/lock.h" +#include "storage/lmgr.h" + +#define READ_LOCK 2 +#define WRITE_LOCK 1 + +/* any time a small granularity READ/WRITE lock is set. + * Higher granularity READ_INTENT/WRITE_INTENT locks must + * also be set. A read intent lock is has value READ+INTENT. + * in this implementation. + */ +#define NO_LOCK 0 +#define INTENT 2 +#define READ_INTENT (READ_LOCK+INTENT) +#define WRITE_INTENT (WRITE_LOCK+INTENT) + +#define EXTEND_LOCK 5 + +#define SHORT_TERM 1 +#define LONG_TERM 2 +#define UNLOCK 0 + +#define N_LEVELS 3 +#define RELN_LEVEL 0 +#define PAGE_LEVEL 1 +#define TUPLE_LEVEL 2 +typedef int LOCK_LEVEL; + +/* multi.c */ + +extern LockTableId MultiTableId; +extern LockTableId ShortTermTableId; + +/* + * function prototypes + */ +extern LockTableId InitMultiLevelLockm(void); +extern bool MultiLockReln(LockInfo linfo, LOCKT lockt); +extern bool MultiLockTuple(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt); +extern bool MultiLockPage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt); +extern bool MultiAcquire(LockTableId tableId, LOCKTAG *tag, LOCKT lockt, + LOCK_LEVEL level); +extern bool MultiReleasePage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt); +extern bool MultiReleaseReln(LockInfo linfo, LOCKT lockt); +extern bool MultiRelease(LockTableId tableId, LOCKTAG *tag, LOCKT lockt, + LOCK_LEVEL level); + +#endif /* MULTILEV_H */ |