mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Remove useless LockDisable() function and associated overhead, per my
proposal of 26-Aug.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.94 2001/09/07 00:27:29 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.95 2001/09/27 16:29:12 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Outside modules can create a lock table and acquire/release
|
||||
@@ -165,11 +165,6 @@ SPINLOCK LockMgrLock; /* in Shmem or created in
|
||||
static LOCKMASK BITS_OFF[MAX_LOCKMODES];
|
||||
static LOCKMASK BITS_ON[MAX_LOCKMODES];
|
||||
|
||||
/*
|
||||
* Disable flag
|
||||
*/
|
||||
static bool LockingIsDisabled;
|
||||
|
||||
/*
|
||||
* map from lockmethod to the lock table structure
|
||||
*/
|
||||
@@ -195,23 +190,6 @@ InitLocks(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* LockDisable -- sets LockingIsDisabled flag to TRUE or FALSE.
|
||||
*/
|
||||
void
|
||||
LockDisable(bool status)
|
||||
{
|
||||
LockingIsDisabled = status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Boolean function to determine current locking status
|
||||
*/
|
||||
bool
|
||||
LockingDisabled(void)
|
||||
{
|
||||
return LockingIsDisabled;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetch the lock method table associated with a given lock
|
||||
@@ -509,9 +487,6 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (LockingIsDisabled)
|
||||
return TRUE;
|
||||
|
||||
masterLock = lockMethodTable->ctl->masterLock;
|
||||
|
||||
SpinAcquire(masterLock);
|
||||
@@ -1047,9 +1022,6 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (LockingIsDisabled)
|
||||
return TRUE;
|
||||
|
||||
masterLock = lockMethodTable->ctl->masterLock;
|
||||
SpinAcquire(masterLock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user