Skip to content

Commit 5e6528a

Browse files
committed
* -Remove LockMethodTable.prio field, not used (Bruce)
1 parent 7dfc7e9 commit 5e6528a

File tree

3 files changed

+9
-39
lines changed

3 files changed

+9
-39
lines changed

src/backend/storage/lmgr/lmgr.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.53 2002/06/20 20:29:35 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.54 2002/08/01 05:18:33 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -65,40 +65,20 @@ static LOCKMASK LockConflicts[] = {
6565

6666
};
6767

68-
static int LockPrios[] = {
69-
0,
70-
/* AccessShareLock */
71-
1,
72-
/* RowShareLock */
73-
2,
74-
/* RowExclusiveLock */
75-
3,
76-
/* ShareUpdateExclusiveLock */
77-
4,
78-
/* ShareLock */
79-
5,
80-
/* ShareRowExclusiveLock */
81-
6,
82-
/* ExclusiveLock */
83-
7,
84-
/* AccessExclusiveLock */
85-
8
86-
};
87-
8868
LOCKMETHOD LockTableId = (LOCKMETHOD) NULL;
8969
LOCKMETHOD LongTermTableId = (LOCKMETHOD) NULL;
9070

9171
/*
92-
* Create the lock table described by LockConflicts and LockPrios.
72+
* Create the lock table described by LockConflicts
9373
*/
9474
LOCKMETHOD
9575
InitLockTable(int maxBackends)
9676
{
9777
int lockmethod;
9878

9979
lockmethod = LockMethodTableInit("LockTable",
100-
LockConflicts, LockPrios,
101-
MAX_LOCKMODES - 1, maxBackends);
80+
LockConflicts, MAX_LOCKMODES - 1,
81+
maxBackends);
10282
LockTableId = lockmethod;
10383

10484
if (!(LockTableId))

src/backend/storage/lmgr/lock.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.110 2002/07/19 00:17:40 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.111 2002/08/01 05:18:33 momjian Exp $
1212
*
1313
* NOTES
1414
* Outside modules can create a lock table and acquire/release
@@ -208,18 +208,14 @@ GetLocksMethodTable(LOCK *lock)
208208
static void
209209
LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
210210
LOCKMASK *conflictsP,
211-
int *prioP,
212211
int numModes)
213212
{
214213
int i;
215214

216215
lockMethodTable->numLockModes = numModes;
217216
numModes++;
218-
for (i = 0; i < numModes; i++, prioP++, conflictsP++)
219-
{
217+
for (i = 0; i < numModes; i++, conflictsP++)
220218
lockMethodTable->conflictTab[i] = *conflictsP;
221-
lockMethodTable->prio[i] = *prioP;
222-
}
223219
}
224220

225221
/*
@@ -234,7 +230,6 @@ LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
234230
LOCKMETHOD
235231
LockMethodTableInit(char *tabName,
236232
LOCKMASK *conflictsP,
237-
int *prioP,
238233
int numModes,
239234
int maxBackends)
240235
{
@@ -335,7 +330,7 @@ LockMethodTableInit(char *tabName,
335330
elog(FATAL, "LockMethodTableInit: couldn't initialize %s", tabName);
336331

337332
/* init data structures */
338-
LockMethodInit(lockMethodTable, conflictsP, prioP, numModes);
333+
LockMethodInit(lockMethodTable, conflictsP, numModes);
339334

340335
LWLockRelease(LockMgrLock);
341336

src/include/storage/lock.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: lock.h,v 1.63 2002/07/19 00:17:40 momjian Exp $
10+
* $Id: lock.h,v 1.64 2002/08/01 05:18:34 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -80,10 +80,6 @@ typedef int LOCKMETHOD;
8080
* type conflicts. conflictTab[i] is a mask with the j-th bit
8181
* turned on if lock types i and j conflict.
8282
*
83-
* prio -- each lockmode has a priority, so, for example, waiting
84-
* writers can be given priority over readers (to avoid
85-
* starvation). XXX this field is not actually used at present!
86-
*
8783
* masterLock -- synchronizes access to the table
8884
*
8985
*/
@@ -94,7 +90,6 @@ typedef struct LOCKMETHODTABLE
9490
LOCKMETHOD lockmethod;
9591
int numLockModes;
9692
int conflictTab[MAX_LOCKMODES];
97-
int prio[MAX_LOCKMODES];
9893
LWLockId masterLock;
9994
} LOCKMETHODTABLE;
10095

@@ -215,7 +210,7 @@ typedef struct PROCLOCK
215210
extern void InitLocks(void);
216211
extern LOCKMETHODTABLE *GetLocksMethodTable(LOCK *lock);
217212
extern LOCKMETHOD LockMethodTableInit(char *tabName, LOCKMASK *conflictsP,
218-
int *prioP, int numModes, int maxBackends);
213+
int numModes, int maxBackends);
219214
extern LOCKMETHOD LockMethodTableRename(LOCKMETHOD lockmethod);
220215
extern bool LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
221216
TransactionId xid, LOCKMODE lockmode, bool dontWait);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy