mirror of
https://github.com/postgres/postgres.git
synced 2025-06-03 00:02:26 -04:00
* -Remove LockMethodTable.prio field, not used (Bruce)
This commit is contained in:
parent
7dfc7e9e8c
commit
5e6528adf7
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.53 2002/06/20 20:29:35 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.54 2002/08/01 05:18:33 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 LockTableId = (LOCKMETHOD) NULL;
|
||||||
LOCKMETHOD LongTermTableId = (LOCKMETHOD) NULL;
|
LOCKMETHOD LongTermTableId = (LOCKMETHOD) NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the lock table described by LockConflicts and LockPrios.
|
* Create the lock table described by LockConflicts
|
||||||
*/
|
*/
|
||||||
LOCKMETHOD
|
LOCKMETHOD
|
||||||
InitLockTable(int maxBackends)
|
InitLockTable(int maxBackends)
|
||||||
@ -97,8 +77,8 @@ InitLockTable(int maxBackends)
|
|||||||
int lockmethod;
|
int lockmethod;
|
||||||
|
|
||||||
lockmethod = LockMethodTableInit("LockTable",
|
lockmethod = LockMethodTableInit("LockTable",
|
||||||
LockConflicts, LockPrios,
|
LockConflicts, MAX_LOCKMODES - 1,
|
||||||
MAX_LOCKMODES - 1, maxBackends);
|
maxBackends);
|
||||||
LockTableId = lockmethod;
|
LockTableId = lockmethod;
|
||||||
|
|
||||||
if (!(LockTableId))
|
if (!(LockTableId))
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.110 2002/07/19 00:17:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.111 2002/08/01 05:18:33 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Outside modules can create a lock table and acquire/release
|
* Outside modules can create a lock table and acquire/release
|
||||||
@ -208,18 +208,14 @@ GetLocksMethodTable(LOCK *lock)
|
|||||||
static void
|
static void
|
||||||
LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
|
LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
|
||||||
LOCKMASK *conflictsP,
|
LOCKMASK *conflictsP,
|
||||||
int *prioP,
|
|
||||||
int numModes)
|
int numModes)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
lockMethodTable->numLockModes = numModes;
|
lockMethodTable->numLockModes = numModes;
|
||||||
numModes++;
|
numModes++;
|
||||||
for (i = 0; i < numModes; i++, prioP++, conflictsP++)
|
for (i = 0; i < numModes; i++, conflictsP++)
|
||||||
{
|
|
||||||
lockMethodTable->conflictTab[i] = *conflictsP;
|
lockMethodTable->conflictTab[i] = *conflictsP;
|
||||||
lockMethodTable->prio[i] = *prioP;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -234,7 +230,6 @@ LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
|
|||||||
LOCKMETHOD
|
LOCKMETHOD
|
||||||
LockMethodTableInit(char *tabName,
|
LockMethodTableInit(char *tabName,
|
||||||
LOCKMASK *conflictsP,
|
LOCKMASK *conflictsP,
|
||||||
int *prioP,
|
|
||||||
int numModes,
|
int numModes,
|
||||||
int maxBackends)
|
int maxBackends)
|
||||||
{
|
{
|
||||||
@ -335,7 +330,7 @@ LockMethodTableInit(char *tabName,
|
|||||||
elog(FATAL, "LockMethodTableInit: couldn't initialize %s", tabName);
|
elog(FATAL, "LockMethodTableInit: couldn't initialize %s", tabName);
|
||||||
|
|
||||||
/* init data structures */
|
/* init data structures */
|
||||||
LockMethodInit(lockMethodTable, conflictsP, prioP, numModes);
|
LockMethodInit(lockMethodTable, conflictsP, numModes);
|
||||||
|
|
||||||
LWLockRelease(LockMgrLock);
|
LWLockRelease(LockMgrLock);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: lock.h,v 1.63 2002/07/19 00:17:40 momjian Exp $
|
* $Id: lock.h,v 1.64 2002/08/01 05:18:34 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -80,10 +80,6 @@ typedef int LOCKMETHOD;
|
|||||||
* type conflicts. conflictTab[i] is a mask with the j-th bit
|
* type conflicts. conflictTab[i] is a mask with the j-th bit
|
||||||
* turned on if lock types i and j conflict.
|
* 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
|
* masterLock -- synchronizes access to the table
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -94,7 +90,6 @@ typedef struct LOCKMETHODTABLE
|
|||||||
LOCKMETHOD lockmethod;
|
LOCKMETHOD lockmethod;
|
||||||
int numLockModes;
|
int numLockModes;
|
||||||
int conflictTab[MAX_LOCKMODES];
|
int conflictTab[MAX_LOCKMODES];
|
||||||
int prio[MAX_LOCKMODES];
|
|
||||||
LWLockId masterLock;
|
LWLockId masterLock;
|
||||||
} LOCKMETHODTABLE;
|
} LOCKMETHODTABLE;
|
||||||
|
|
||||||
@ -215,7 +210,7 @@ typedef struct PROCLOCK
|
|||||||
extern void InitLocks(void);
|
extern void InitLocks(void);
|
||||||
extern LOCKMETHODTABLE *GetLocksMethodTable(LOCK *lock);
|
extern LOCKMETHODTABLE *GetLocksMethodTable(LOCK *lock);
|
||||||
extern LOCKMETHOD LockMethodTableInit(char *tabName, LOCKMASK *conflictsP,
|
extern LOCKMETHOD LockMethodTableInit(char *tabName, LOCKMASK *conflictsP,
|
||||||
int *prioP, int numModes, int maxBackends);
|
int numModes, int maxBackends);
|
||||||
extern LOCKMETHOD LockMethodTableRename(LOCKMETHOD lockmethod);
|
extern LOCKMETHOD LockMethodTableRename(LOCKMETHOD lockmethod);
|
||||||
extern bool LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
extern bool LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
||||||
TransactionId xid, LOCKMODE lockmode, bool dontWait);
|
TransactionId xid, LOCKMODE lockmode, bool dontWait);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user