mirror of
https://github.com/postgres/postgres.git
synced 2025-05-14 00:03:46 -04:00
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.
This commit is contained in:
parent
f141880150
commit
eda117dfa0
@ -16,14 +16,14 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.17.2.1 2005/11/22 18:23:19 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.17.2.2 2006/07/22 21:04:46 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user