*** guc.c.orig Tue Mar 17 07:30:26 2009 --- guc.c Tue Mar 17 07:47:10 2009 *************** *** 57,62 **** --- 57,63 ---- #include "postmaster/walwriter.h" #include "regex/regex.h" #include "storage/bufmgr.h" + #include "storage/lwlock.h" #include "storage/fd.h" #include "tcop/tcopprot.h" #include "tsearch/ts_cache.h" *************** *** 167,172 **** --- 168,174 ---- static bool assign_maxconnections(int newval, bool doit, GucSource source); static bool assign_autovacuum_max_workers(int newval, bool doit, GucSource source); static bool assign_effective_io_concurrency(int newval, bool doit, GucSource source); + static bool assign_lock_wakeup_algorithm(int newval, bool doit, GucSource source); static const char *assign_pgstat_temp_directory(const char *newval, bool doit, GucSource source); static char *config_enum_get_options(struct config_enum *record, *************** *** 416,421 **** --- 418,424 ---- static int wal_segment_size; static bool integer_datetimes; static int effective_io_concurrency; + static int lock_wakeup_algorithm; /* should be static, but commands/variable.c needs to get at these */ char *role_string; *************** *** 1727,1732 **** --- 1730,1745 ---- }, { + {"lock_wakeup_algorithm", PGC_USERSET, RESOURCES, + gettext_noop("Select algorithm for lock waiters wakeup. 0 is default"), + gettext_noop("Select 1 for SMP systems, and higher for manual conrol of number of waiters to wake up.") + }, + &lock_wakeup_algorithm, + 0, 0, 32, + assign_lock_wakeup_algorithm, NULL + }, + + { {"log_rotation_age", PGC_SIGHUP, LOGGING_WHERE, gettext_noop("Automatic log file rotation will occur after N minutes."), NULL, *************** *** 7668,7673 **** --- 7681,7698 ---- #endif /* USE_PREFETCH */ } + static bool + assign_lock_wakeup_algorithm(int newval, bool doit, GucSource source) + { + if ( newval < 0 && newval > 32) + return false; + + if (doit) + LWLockWakeupAlgorithm= newval ; + + return true; + } + static const char * assign_pgstat_temp_directory(const char *newval, bool doit, GucSource source) {