Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a95ac415
Commit
a95ac415
authored
Feb 22, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More comment cleanups.
parent
82fc51e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/lock.c
+15
-13
No files found.
src/backend/storage/lmgr/lock.c
View file @
a95ac415
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.8
2 2001/02/22 23:02:33
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.8
3 2001/02/22 23:20:06
momjian Exp $
*
*
* NOTES
* NOTES
* Outside modules can create a lock table and acquire/release
* Outside modules can create a lock table and acquire/release
...
@@ -45,7 +45,7 @@ static int WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode,
...
@@ -45,7 +45,7 @@ static int WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode,
static
void
LockCountMyLocks
(
SHMEM_OFFSET
lockOffset
,
PROC
*
proc
,
static
void
LockCountMyLocks
(
SHMEM_OFFSET
lockOffset
,
PROC
*
proc
,
int
*
myHolding
);
int
*
myHolding
);
static
char
*
lock_
typ
es
[]
=
static
char
*
lock_
mode_nam
es
[]
=
{
{
"INVALID"
,
"INVALID"
,
"AccessShareLock"
,
"AccessShareLock"
,
...
@@ -65,16 +65,18 @@ static char *DeadLockMessage = "Deadlock detected.\n\tSee the lock(l) manual pag
...
@@ -65,16 +65,18 @@ static char *DeadLockMessage = "Deadlock detected.\n\tSee the lock(l) manual pag
/*------
/*------
* The following configuration options are available for lock debugging:
* The following configuration options are available for lock debugging:
*
*
*
trace_locks
-- give a bunch of output what's going on in this file
*
TRACE_LOCKS
-- give a bunch of output what's going on in this file
*
trace_userlocks
-- same but for user locks
*
TRACE_USERLOCKS
-- same but for user locks
*
trace_lock_oidmin
-- do not trace locks for tables below this oid
*
TRACE_LOCK_OIDMIN
-- do not trace locks for tables below this oid
* (use to avoid output on system tables)
* (use to avoid output on system tables)
* trace_lock_table -- trace locks on this table (oid) unconditionally
* TRACE_LOCK_TABLE -- trace locks on this table (oid) unconditionally
* debug_deadlocks -- currently dumps locks at untimely occasions ;)
* DEBUG_DEADLOCKS -- currently dumps locks at untimely occasions ;)
*
* Furthermore, but in storage/ipc/spin.c:
* Furthermore, but in storage/ipc/spin.c:
*
trace_spinlocks
-- trace spinlocks (pretty useless)
*
TRACE_SPINLOCKS
-- trace spinlocks (pretty useless)
*
*
* Define LOCK_DEBUG at compile time to get all this enabled.
* Define LOCK_DEBUG at compile time to get all these enabled.
* --------
*/
*/
int
Trace_lock_oidmin
=
BootstrapObjectIdData
;
int
Trace_lock_oidmin
=
BootstrapObjectIdData
;
...
@@ -112,7 +114,7 @@ LOCK_PRINT(const char * where, const LOCK * lock, LOCKMODE type)
...
@@ -112,7 +114,7 @@ LOCK_PRINT(const char * where, const LOCK * lock, LOCKMODE type)
lock
->
granted
[
1
],
lock
->
granted
[
2
],
lock
->
granted
[
3
],
lock
->
granted
[
1
],
lock
->
granted
[
2
],
lock
->
granted
[
3
],
lock
->
granted
[
4
],
lock
->
granted
[
5
],
lock
->
granted
[
6
],
lock
->
granted
[
4
],
lock
->
granted
[
5
],
lock
->
granted
[
6
],
lock
->
granted
[
7
],
lock
->
nGranted
,
lock
->
granted
[
7
],
lock
->
nGranted
,
lock
->
waitProcs
.
size
,
lock_
typ
es
[
type
]);
lock
->
waitProcs
.
size
,
lock_
mode_nam
es
[
type
]);
}
}
...
@@ -494,7 +496,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
...
@@ -494,7 +496,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
#ifdef LOCK_DEBUG
#ifdef LOCK_DEBUG
if
(
lockmethod
==
USER_LOCKMETHOD
&&
Trace_userlocks
)
if
(
lockmethod
==
USER_LOCKMETHOD
&&
Trace_userlocks
)
elog
(
DEBUG
,
"LockAcquire: user lock [%u] %s"
,
elog
(
DEBUG
,
"LockAcquire: user lock [%u] %s"
,
locktag
->
objId
.
blkno
,
lock_
typ
es
[
lockmode
]);
locktag
->
objId
.
blkno
,
lock_
mode_nam
es
[
lockmode
]);
#endif
#endif
/* ???????? This must be changed when short term locks will be used */
/* ???????? This must be changed when short term locks will be used */
...
@@ -615,7 +617,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
...
@@ -615,7 +617,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
break
;
/* safe: we have a lock >= req level */
break
;
/* safe: we have a lock >= req level */
elog
(
DEBUG
,
"Deadlock risk: raising lock level"
elog
(
DEBUG
,
"Deadlock risk: raising lock level"
" from %s to %s on object %u/%u/%u"
,
" from %s to %s on object %u/%u/%u"
,
lock_
types
[
i
],
lock_typ
es
[
lockmode
],
lock_
mode_names
[
i
],
lock_mode_nam
es
[
lockmode
],
lock
->
tag
.
relId
,
lock
->
tag
.
dbId
,
lock
->
tag
.
objId
.
blkno
);
lock
->
tag
.
relId
,
lock
->
tag
.
dbId
,
lock
->
tag
.
objId
.
blkno
);
break
;
break
;
}
}
...
@@ -1123,7 +1125,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
...
@@ -1123,7 +1125,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
Assert
(
holder
->
holding
[
lockmode
]
>=
0
);
Assert
(
holder
->
holding
[
lockmode
]
>=
0
);
SpinRelease
(
masterLock
);
SpinRelease
(
masterLock
);
elog
(
NOTICE
,
"LockRelease: you don't own a lock of type %s"
,
elog
(
NOTICE
,
"LockRelease: you don't own a lock of type %s"
,
lock_
typ
es
[
lockmode
]);
lock_
mode_nam
es
[
lockmode
]);
return
FALSE
;
return
FALSE
;
}
}
Assert
(
holder
->
nHolding
>
0
);
Assert
(
holder
->
nHolding
>
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment