From: Tom Lane Date: Sat, 22 Jul 2006 21:04:46 +0000 (+0000) Subject: Hmm, seems --disable-spinlocks has been broken for awhile and nobody X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=e02362f20cc9b7811c222c9a51476e7d7b4fb51a;p=users%2Fbernd%2Fpostgres.git Hmm, seems --disable-spinlocks has been broken for awhile and nobody noticed. Fix SpinlockSemas() to report the correct count considering that PG 8.1 adds a spinlock to each shared-buffer header. --- diff --git a/src/backend/storage/lmgr/spin.c b/src/backend/storage/lmgr/spin.c index e5f598b4c7..98b8e4afe8 100644 --- a/src/backend/storage/lmgr/spin.c +++ b/src/backend/storage/lmgr/spin.c @@ -22,8 +22,8 @@ */ #include "postgres.h" +#include "miscadmin.h" #include "storage/lwlock.h" -#include "storage/pg_sema.h" #include "storage/spin.h" @@ -55,9 +55,9 @@ SpinlockSemas(void) * similar to the way shmem space estimation is handled. * * For now, though, we just need a few spinlocks (10 should be plenty) - * plus one for each LWLock. + * plus one for each LWLock and one for each buffer header. */ - return NumLWLocks() + 10; + return NumLWLocks() + NBuffers + 10; } /*