Skip to content

Commit bb55e58

Browse files
committed
Allocate a few extra LWLocks for possible use by add-on modules.
Per request from Marc Munro.
1 parent 426d015 commit bb55e58

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/backend/storage/lmgr/lwlock.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Portions Copyright (c) 1994, Regents of the University of California
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.30 2005/09/16 00:30:05 tgl Exp $
18+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.31 2005/10/07 20:11:03 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -140,7 +140,8 @@ NumLWLocks(void)
140140
*/
141141
numLocks += 2 * NUM_SLRU_BUFFERS;
142142

143-
/* Perhaps create a few more for use by user-defined modules? */
143+
/* Leave a few extra for use by user-defined modules. */
144+
numLocks += NUM_USER_DEFINED_LWLOCKS;
144145

145146
return numLocks;
146147
}

src/include/pg_config_manual.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* for developers. If you edit any of these, be sure to do a *full*
77
* rebuild (and an initdb if noted).
88
*
9-
* $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.17 2005/10/03 22:55:56 tgl Exp $
9+
* $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.18 2005/10/07 20:11:03 tgl Exp $
1010
*------------------------------------------------------------------------
1111
*/
1212

@@ -74,6 +74,11 @@
7474
*/
7575
#define INDEX_MAX_KEYS 32
7676

77+
/*
78+
* Number of spare LWLocks to allocate for user-defined add-on code.
79+
*/
80+
#define NUM_USER_DEFINED_LWLOCKS 4
81+
7782
/*
7883
* Define this to make libpgtcl's "pg_result -assign" command process
7984
* C-style backslash sequences in returned tuple data and convert

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy