git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb4b7a0)
Use an always-there test, not an Assert, to check for overrun of
Fri, 8 Apr 2005 03:43:54 +0000 (03:43 +0000)
Fri, 8 Apr 2005 03:43:54 +0000 (03:43 +0000)
the held_lwlocks[] array. Per Qingqing Zhou.


diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index 444b04a56ed6c5044cda54a2cb9aa0d3797b6d54..112690ae903cf87f1d4396ac05a1faf66de78772 100644 (file)
--- 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;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /