pgsql-server/src backend/storage/ipc/ipci.c ba ...

From: momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server/src backend/storage/ipc/ipci.c ba ...
Date: 2003-12-01 21:59:27
Message-ID: 20031201215927.14DE2D1D23B@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: momjian(at)svr1(dot)postgresql(dot)org 03/12/01 17:59:26

Modified files:
src/backend/storage/ipc: ipci.c
src/backend/storage/lmgr: deadlock.c lmgr.c lock.c proc.c
src/include/storage: lmgr.h lock.h proc.h

Log message:
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

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2003-12-01 22:08:03 pgsql-server/ oc/src/sgml/datatype.sgml oc/src ...
Previous Message Bruce Momjian 2003-12-01 21:53:16 pgsql-server/doc/src/sgml typeconv.sgml