mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 21:36:52 +02:00
Use an always-there test, not an Assert, to check for overrun of
the held_lwlocks[] array. Per Qingqing Zhou.
This commit is contained in:
parent
eb4b7a0b77
commit
e794dfa511
@ -15,7 +15,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.25 2004/12/31 22:01:05 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.26 2005/04/08 03:43:54 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -328,7 +328,8 @@ LWLockAcquire(LWLockId lockid, LWLockMode mode)
|
|||||||
SpinLockRelease_NoHoldoff(&lock->mutex);
|
SpinLockRelease_NoHoldoff(&lock->mutex);
|
||||||
|
|
||||||
/* Add lock to list of locks held by this backend */
|
/* Add lock to list of locks held by this backend */
|
||||||
Assert(num_held_lwlocks < MAX_SIMUL_LWLOCKS);
|
if (num_held_lwlocks >= MAX_SIMUL_LWLOCKS)
|
||||||
|
elog(ERROR, "too many LWLocks taken");
|
||||||
held_lwlocks[num_held_lwlocks++] = lockid;
|
held_lwlocks[num_held_lwlocks++] = lockid;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -397,7 +398,8 @@ LWLockConditionalAcquire(LWLockId lockid, LWLockMode mode)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Add lock to list of locks held by this backend */
|
/* Add lock to list of locks held by this backend */
|
||||||
Assert(num_held_lwlocks < MAX_SIMUL_LWLOCKS);
|
if (num_held_lwlocks >= MAX_SIMUL_LWLOCKS)
|
||||||
|
elog(ERROR, "too many LWLocks taken");
|
||||||
held_lwlocks[num_held_lwlocks++] = lockid;
|
held_lwlocks[num_held_lwlocks++] = lockid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user