blob: 0f8218e175544aa498558516b1c5f37e8b0fafa5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  | 
/*-------------------------------------------------------------------------
 *
 * 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.6 1998/01/23 19:53:44 scrappy Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef MULTILEV_H
#define MULTILEV_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 PG_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 MultiReleaseReln(LockInfo linfo, LOCKT lockt);
#endif							/* MULTILEV_H */
  |