summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/ipci.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-12-01 21:59:25 +0000
committerBruce Momjian <bruce@momjian.us>2003-12-01 21:59:25 +0000
commite7ca8674858f03a1bd6222bdb4de3d829cffbcc4 (patch)
treeb0b2be89de7ab564dcf2a9fc788c90d4b95ca83b /src/backend/storage/ipc/ipci.c
parente2ac58c7bd3e714bdf6c140b459c94b454b7b291 (diff)
downloadpostgresql-e7ca8674858f03a1bd6222bdb4de3d829cffbcc4.tar.gz
Try to reduce confusion about what is a lock method identifier, a lock
method control structure, or a table of control structures. . Use type LOCKMASK where an int is not a counter. . Get rid of INVALID_TABLEID, use INVALID_LOCKMETHOD instead. . Use INVALID_LOCKMETHOD instead of (LOCKMETHOD) NULL, because LOCKMETHOD is not a pointer. . Define and use macro LockMethodIsValid. . Rename LOCKMETHOD to LOCKMETHODID. . Remove global variable LongTermTableId in lmgr.c, because it is never used. . Make LockTableId static in lmgr.c, because it is used nowhere else. Why not remove it and use DEFAULT_LOCKMETHOD? . Rename the lock method control structure from LOCKMETHODTABLE to LockMethodData. Introduce a pointer type named LockMethod. . Remove elog(FATAL) after InitLockTable() call in CreateSharedMemoryAndSemaphores(), because if something goes wrong, there is elog(FATAL) in LockMethodTableInit(), and if this doesn't help, an elog(ERROR) in InitLockTable() is promoted to FATAL. . Make InitLockTable() void, because its only caller does not use its return value any more. . Rename variables in lock.c to avoid statements like LockMethodTable[NumLockMethods] = lockMethodTable; lockMethodTable = LockMethodTable[lockmethod]; . Change LOCKMETHODID type to uint16 to fit into struct LOCKTAG. . Remove static variables BITS_OFF and BITS_ON from lock.c, because I agree to this doubt: * XXX is a fetch from a static array really faster than a shift? . Define and use macros LOCKBIT_ON/OFF. Manfred Koizar
Diffstat (limited to 'src/backend/storage/ipc/ipci.c')
-rw-r--r--src/backend/storage/ipc/ipci.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c
index 2494d13a7a..982846843a 100644
--- a/src/backend/storage/ipc/ipci.c
+++ b/src/backend/storage/ipc/ipci.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/ipc/ipci.c,v 1.58 2003/11/29 19:51:56 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/ipc/ipci.c,v 1.59 2003/12/01 21:59:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -111,8 +111,7 @@ CreateSharedMemoryAndSemaphores(bool makePrivate,
* Set up lock manager
*/
InitLocks();
- if (InitLockTable(maxBackends) == INVALID_TABLEID)
- elog(FATAL, "could not create the lock table");
+ InitLockTable(maxBackends);
/*
* Set up process table