diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-08 03:43:54 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-08 03:43:54 +0000 |
commit | e794dfa51144574dfbf51716c22116d03c7da7ca (patch) | |
tree | a769a67ca0da4cf59136d2f70e7202043da271ab /src | |
parent | eb4b7a0b778ab2e67e43b41822ddae32803a30e3 (diff) |
Use an always-there test, not an Assert, to check for overrun of
the held_lwlocks[] array. Per Qingqing Zhou.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 444b04a56ed..112690ae903 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * 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); /* 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; /* @@ -397,7 +398,8 @@ LWLockConditionalAcquire(LWLockId lockid, LWLockMode mode) else { /* 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; } |