Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
51d7e256
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
51d7e256
编写于
8月 26, 2004
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve some comments.
上级
dd9923eb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
20 deletion
+25
-20
src/include/storage/lock.h
src/include/storage/lock.h
+25
-20
未找到文件。
src/include/storage/lock.h
浏览文件 @
51d7e256
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.
79 2004/07/17 03:31:26
tgl Exp $
* $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.
80 2004/08/26 17:22:28
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -26,10 +26,10 @@ typedef struct PROC_QUEUE
int
size
;
/* number of entries in list */
}
PROC_QUEUE
;
/* struct PGPROC is declared in
storage/
proc.h, but must forward-reference it */
/* struct PGPROC is declared in proc.h, but must forward-reference it */
typedef
struct
PGPROC
PGPROC
;
/* GUC variables */
extern
int
max_locks_per_xact
;
#ifdef LOCK_DEBUG
...
...
@@ -41,6 +41,11 @@ extern bool Debug_deadlocks;
#endif
/* LOCK_DEBUG */
/*
* LOCKMODE is an integer (1..N) indicating a lock type. LOCKMASK is a bit
* mask indicating a set of held or requested lock types (the bit 1<<mode
* corresponds to a particular lock mode).
*/
typedef
int
LOCKMASK
;
typedef
int
LOCKMODE
;
/* MAX_LOCKMODES cannot be larger than the # of bits in LOCKMASK */
...
...
@@ -49,6 +54,11 @@ typedef int LOCKMODE;
#define LOCKBIT_ON(lockmode) (1 << (lockmode))
#define LOCKBIT_OFF(lockmode) (~(1 << (lockmode)))
/*
* There is normally only one lock method, the default one.
* If user locks are enabled, an additional lock method is present.
* Lock methods are identified by LOCKMETHODID.
*/
typedef
uint16
LOCKMETHODID
;
/* MAX_LOCK_METHODS is the number of distinct lock control tables allowed */
#define MAX_LOCK_METHODS 3
...
...
@@ -60,18 +70,13 @@ typedef uint16 LOCKMETHODID;
#define LockMethodIsValid(lockmethodid) ((lockmethodid) != INVALID_LOCKMETHOD)
/*
* There is normally only one lock method, the default one.
* If user locks are enabled, an additional lock method is present.
*
* This is the control structure for a lock table. It
* lives in shared memory. This information is the same
* for all backends.
* This is the control structure for a lock table. It lives in shared
* memory. Currently, none of these fields change after startup. In addition
* to the LockMethodData, a lock table has a "lockHash" table holding
* per-locked-object lock information, and a "proclockHash" table holding
* per-lock-holder/waiter lock information.
*
* lockHash -- hash table holding per-locked-object lock information
*
* proclockHash -- hash table holding per-lock-waiter/holder lock information
*
* lockmethod -- the handle used by the lock table's clients to
* lockmethodid -- the handle used by the lock table's clients to
* refer to the type of lock table being used.
*
* numLockModes -- number of lock types (READ,WRITE,etc) that
...
...
@@ -81,8 +86,7 @@ typedef uint16 LOCKMETHODID;
* type conflicts. conflictTab[i] is a mask with the j-th bit
* turned on if lock types i and j conflict.
*
* masterLock -- synchronizes access to the table
*
* masterLock -- LWLock used to synchronize access to the table
*/
typedef
struct
LockMethodData
{
...
...
@@ -156,12 +160,13 @@ typedef struct LOCK
/*
* We may have several different transactions holding or awaiting locks
* on the same lockable object. We need to store some per-waiter/holder
* information for each such holder (or would-be holder).
* on the same lockable object. We need to store some per-holder/waiter
* information for each such holder (or would-be holder). This is kept in
* a PROCLOCK struct.
*
* PROCLOCKTAG is the key information needed to look up a PROCLOCK item in the
* proclock hashtable. A PROCLOCKTAG value uniquely identifies
a lock
*
holder/waiter
.
* proclock hashtable. A PROCLOCKTAG value uniquely identifies
the combination
*
of a lockable object and a holder/waiter for that object
.
*
* There are two possible kinds of proclock tags: a transaction (identified
* both by the PGPROC of the backend running it, and the xact's own ID) and
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录