Created
March 31, 2016 16:41
-
-
Save akorotkov/a8ab5d1db83796ce117a8fef63d8d10c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pg_stat_kcache.c b/pg_stat_kcache.c | |
index 63fb4ec..0328209 100644 | |
--- a/pg_stat_kcache.c | |
+++ b/pg_stat_kcache.c | |
@@ -152,7 +152,7 @@ _PG_init(void) | |
* Define (or redefine) custom GUC variables. | |
*/ | |
RequestAddinShmemSpace(pgsk_memsize()); | |
- RequestAddinLWLocks(1); | |
+ RequestNamedLWLockTranche("pg_stat_kcache", 1); | |
/* Install hook */ | |
prev_shmem_startup_hook = shmem_startup_hook; | |
@@ -200,7 +200,7 @@ pgsk_shmem_startup(void) | |
if (!found) | |
{ | |
/* First time through ... */ | |
- pgsk->lock = LWLockAssign(); | |
+ pgsk->lock = &(GetNamedLWLockTranche("pg_stat_kcache"))->lock;; | |
} | |
/* retrieve pg_stat_statements.max */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment