Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
5e6528ad
Commit
5e6528ad
authored
22 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
* -Remove LockMethodTable.prio field, not used (Bruce)
parent
7dfc7e9e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/storage/lmgr/lmgr.c
+4
-24
4 additions, 24 deletions
src/backend/storage/lmgr/lmgr.c
src/backend/storage/lmgr/lock.c
+3
-8
3 additions, 8 deletions
src/backend/storage/lmgr/lock.c
src/include/storage/lock.h
+2
-7
2 additions, 7 deletions
src/include/storage/lock.h
with
9 additions
and
39 deletions
src/backend/storage/lmgr/lmgr.c
+
4
−
24
View file @
5e6528ad
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.5
3
2002/0
6/20 20:29
:3
5
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.5
4
2002/0
8/01 05:18
:3
3
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -65,31 +65,11 @@ static LOCKMASK LockConflicts[] = {
};
static
int
LockPrios
[]
=
{
0
,
/* AccessShareLock */
1
,
/* RowShareLock */
2
,
/* RowExclusiveLock */
3
,
/* ShareUpdateExclusiveLock */
4
,
/* ShareLock */
5
,
/* ShareRowExclusiveLock */
6
,
/* ExclusiveLock */
7
,
/* AccessExclusiveLock */
8
};
LOCKMETHOD
LockTableId
=
(
LOCKMETHOD
)
NULL
;
LOCKMETHOD
LongTermTableId
=
(
LOCKMETHOD
)
NULL
;
/*
* Create the lock table described by LockConflicts
and LockPrios.
* Create the lock table described by LockConflicts
*/
LOCKMETHOD
InitLockTable
(
int
maxBackends
)
...
...
@@ -97,8 +77,8 @@ InitLockTable(int maxBackends)
int
lockmethod
;
lockmethod
=
LockMethodTableInit
(
"LockTable"
,
LockConflicts
,
LockPrios
,
MAX_LOCKMODES
-
1
,
maxBackends
);
LockConflicts
,
MAX_LOCKMODES
-
1
,
maxBackends
);
LockTableId
=
lockmethod
;
if
(
!
(
LockTableId
))
...
...
This diff is collapsed.
Click to expand it.
src/backend/storage/lmgr/lock.c
+
3
−
8
View file @
5e6528ad
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.11
0
2002/0
7/19
0
0
:1
7:40
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.11
1
2002/0
8/01
0
5
:1
8:33
momjian Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
...
...
@@ -208,18 +208,14 @@ GetLocksMethodTable(LOCK *lock)
static
void
LockMethodInit
(
LOCKMETHODTABLE
*
lockMethodTable
,
LOCKMASK
*
conflictsP
,
int
*
prioP
,
int
numModes
)
{
int
i
;
lockMethodTable
->
numLockModes
=
numModes
;
numModes
++
;
for
(
i
=
0
;
i
<
numModes
;
i
++
,
prioP
++
,
conflictsP
++
)
{
for
(
i
=
0
;
i
<
numModes
;
i
++
,
conflictsP
++
)
lockMethodTable
->
conflictTab
[
i
]
=
*
conflictsP
;
lockMethodTable
->
prio
[
i
]
=
*
prioP
;
}
}
/*
...
...
@@ -234,7 +230,6 @@ LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
LOCKMETHOD
LockMethodTableInit
(
char
*
tabName
,
LOCKMASK
*
conflictsP
,
int
*
prioP
,
int
numModes
,
int
maxBackends
)
{
...
...
@@ -335,7 +330,7 @@ LockMethodTableInit(char *tabName,
elog
(
FATAL
,
"LockMethodTableInit: couldn't initialize %s"
,
tabName
);
/* init data structures */
LockMethodInit
(
lockMethodTable
,
conflictsP
,
prioP
,
numModes
);
LockMethodInit
(
lockMethodTable
,
conflictsP
,
numModes
);
LWLockRelease
(
LockMgrLock
);
...
...
This diff is collapsed.
Click to expand it.
src/include/storage/lock.h
+
2
−
7
View file @
5e6528ad
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: lock.h,v 1.6
3
2002/0
7/19
0
0
:1
7:40
momjian Exp $
* $Id: lock.h,v 1.6
4
2002/0
8/01
0
5
:1
8:34
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -80,10 +80,6 @@ typedef int LOCKMETHOD;
* type conflicts. conflictTab[i] is a mask with the j-th bit
* turned on if lock types i and j conflict.
*
* prio -- each lockmode has a priority, so, for example, waiting
* writers can be given priority over readers (to avoid
* starvation). XXX this field is not actually used at present!
*
* masterLock -- synchronizes access to the table
*
*/
...
...
@@ -94,7 +90,6 @@ typedef struct LOCKMETHODTABLE
LOCKMETHOD
lockmethod
;
int
numLockModes
;
int
conflictTab
[
MAX_LOCKMODES
];
int
prio
[
MAX_LOCKMODES
];
LWLockId
masterLock
;
}
LOCKMETHODTABLE
;
...
...
@@ -215,7 +210,7 @@ typedef struct PROCLOCK
extern
void
InitLocks
(
void
);
extern
LOCKMETHODTABLE
*
GetLocksMethodTable
(
LOCK
*
lock
);
extern
LOCKMETHOD
LockMethodTableInit
(
char
*
tabName
,
LOCKMASK
*
conflictsP
,
int
*
prioP
,
int
numModes
,
int
maxBackends
);
int
numModes
,
int
maxBackends
);
extern
LOCKMETHOD
LockMethodTableRename
(
LOCKMETHOD
lockmethod
);
extern
bool
LockAcquire
(
LOCKMETHOD
lockmethod
,
LOCKTAG
*
locktag
,
TransactionId
xid
,
LOCKMODE
lockmode
,
bool
dontWait
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment