From 64a109b532ac3d13f98cd2fdea6a684ee72b1af7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 7 Oct 2005 20:11:03 +0000 Subject: [PATCH] Allocate a few extra LWLocks for possible use by add-on modules. Per request from Marc Munro. --- src/backend/storage/lmgr/lwlock.c | 3 ++- src/include/pg_config_manual.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 9d9b30c1ea..d50d3db90b 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -140,7 +140,8 @@ NumLWLocks(void) */ numLocks += 2 * NUM_SLRU_BUFFERS; - /* Perhaps create a few more for use by user-defined modules? */ + /* Leave a few extra for use by user-defined modules. */ + numLocks += NUM_USER_DEFINED_LWLOCKS; return numLocks; } diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index 699e3c116b..e5320a3ef6 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -74,6 +74,11 @@ */ #define INDEX_MAX_KEYS 32 +/* + * Number of spare LWLocks to allocate for user-defined add-on code. + */ +#define NUM_USER_DEFINED_LWLOCKS 4 + /* * Define this to make libpgtcl's "pg_result -assign" command process * C-style backslash sequences in returned tuple data and convert -- 2.39.5