noticed. Fix SpinlockSemas() to report the correct count considering
that PG 8.1 adds a spinlock to each shared-buffer header.
*/
#include "postgres.h"
+#include "miscadmin.h"
#include "storage/lwlock.h"
-#include "storage/pg_sema.h"
#include "storage/spin.h"
* 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;
}
/*