Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
661bb388
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,发现更多精彩内容 >>
提交
661bb388
编写于
1月 23, 1998
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleanup deadlock message.
上级
c487962d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
9 deletion
+41
-9
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/lock.c
+2
-3
src/backend/storage/lmgr/proc.c
src/backend/storage/lmgr/proc.c
+4
-3
src/include/storage/proc.h
src/include/storage/proc.h
+2
-3
src/man/lock.l
src/man/lock.l
+33
-0
未找到文件。
src/backend/storage/lmgr/lock.c
浏览文件 @
661bb388
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.1
8 1998/01/07 21:05:32
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.1
9 1998/01/23 06:01:03
momjian Exp $
*
*
* NOTES
* NOTES
* Outside modules can create a lock table and acquire/release
* Outside modules can create a lock table and acquire/release
...
@@ -48,8 +48,7 @@
...
@@ -48,8 +48,7 @@
#include "access/xact.h"
#include "access/xact.h"
#include "access/transam.h"
#include "access/transam.h"
static
int
static
int
WaitOnLock
(
LOCKTAB
*
ltable
,
LockTableId
tableId
,
LOCK
*
lock
,
WaitOnLock
(
LOCKTAB
*
ltable
,
LockTableId
tableId
,
LOCK
*
lock
,
LOCKT
lockt
);
LOCKT
lockt
);
/*#define LOCK_MGR_DEBUG*/
/*#define LOCK_MGR_DEBUG*/
...
...
src/backend/storage/lmgr/proc.c
浏览文件 @
661bb388
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
5 1998/01/07 21:05:36
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
6 1998/01/23 06:01:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
* sets run out pretty fast.) -ay 4/95
*
*
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
5 1998/01/07 21:05:36
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
6 1998/01/23 06:01:05
momjian Exp $
*/
*/
#include <sys/time.h>
#include <sys/time.h>
#include <unistd.h>
#include <unistd.h>
...
@@ -729,7 +729,8 @@ HandleDeadLock(int sig)
...
@@ -729,7 +729,8 @@ HandleDeadLock(int sig)
*/
*/
UnlockLockTable
();
UnlockLockTable
();
elog
(
NOTICE
,
"Timeout -- possible deadlock"
);
elog
(
NOTICE
,
"Timeout interval reached -- possible deadlock."
);
elog
(
NOTICE
,
"See the lock(l) manual page for a possible cause."
);
return
;
return
;
}
}
...
...
src/include/storage/proc.h
浏览文件 @
661bb388
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: proc.h,v 1.
8 1997/09/08 21:54:32
momjian Exp $
* $Id: proc.h,v 1.
9 1998/01/23 06:01:25
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -102,8 +102,7 @@ extern bool ProcRemove(int pid);
...
@@ -102,8 +102,7 @@ extern bool ProcRemove(int pid);
/* make static in storage/lmgr/proc.c -- jolly */
/* make static in storage/lmgr/proc.c -- jolly */
extern
void
ProcQueueInit
(
PROC_QUEUE
*
queue
);
extern
void
ProcQueueInit
(
PROC_QUEUE
*
queue
);
extern
int
extern
int
ProcSleep
(
PROC_QUEUE
*
queue
,
SPINLOCK
spinlock
,
int
token
,
ProcSleep
(
PROC_QUEUE
*
queue
,
SPINLOCK
spinlock
,
int
token
,
int
prio
,
LOCK
*
lock
);
int
prio
,
LOCK
*
lock
);
extern
int
ProcLockWakeup
(
PROC_QUEUE
*
queue
,
char
*
ltable
,
char
*
lock
);
extern
int
ProcLockWakeup
(
PROC_QUEUE
*
queue
,
char
*
ltable
,
char
*
lock
);
extern
void
ProcAddLock
(
SHM_QUEUE
*
elem
);
extern
void
ProcAddLock
(
SHM_QUEUE
*
elem
);
...
...
src/man/lock.l
0 → 100644
浏览文件 @
661bb388
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.1 1998/01/23 06:01:36 momjian Exp $
.TH FETCH SQL 01/23/93 PostgreSQL PostgreSQL
.SH NAME
lock - exclusive lock a table
.SH SYNOPSIS
.nf
\fBlock\fR classname
.fi
.SH DESCRIPTION
.BR lock
exclusive locks a table inside a transaction. The classic use for this
is the case where you want to \fBselect\fP some data, then update it
inside a transaction. If you don't exclusive lock the table before the
\fBselect\fP, some other user may also read the selected data, and try
and do their own \fBupdate\fP, causing a deadlock while you both wait
for the other to release the \fBselect\fP-induced shared lock so you can
get an exclusive lock to do the \fBupdate.\fP
.SH EXAMPLES
.nf
--
-- Proper locking to prevent deadlock
--
begin work;
lock mytable;
select * from mytable;
update mytable set (x = 100);
end work;
.SH "SEE ALSO"
begin(l),
end(l),
select(l).
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录