postgresql/src/backend
Robert Haas f2e6a2ccf1 Add API to check if an existing exclusive lock allows cleanup.
LockBufferForCleanup() acquires a cleanup lock unconditionally, and
ConditionalLockBufferForCleanup() acquires a cleanup lock if it is
possible to do so without waiting; this patch adds a new API,
IsBufferCleanupOK(), which tests whether an exclusive lock already
held happens to be a cleanup lock.  This is possible because a cleanup
lock simply means an exclusive lock plus the assurance any other pins
on the buffer are newer than our own pin.  Therefore, just as the
existing functions decide that the exclusive lock that they've just
taken is a cleanup lock if they observe the pin count to be 1, this
new function allows us to observe that the pin count is 1 on a buffer
we've already locked.

This is useful in situations where a backend definitely wishes to
modify the buffer and also wishes to perform cleanup operations if
possible.  The patch to eliminate heavyweight locking by hash indexes
uses this, and it may have other applications as well.

Amit Kapila, per a suggestion from me.  Some comment adjustments by me
as well.
2016-11-04 09:32:24 -04:00
..
access Fix leftover reference to background writer performing checkpoints. 2016-10-28 09:09:00 -04:00
bootstrap Fix a bunch of places that called malloc and friends with no NULL check. 2016-08-30 18:22:43 -04:00
catalog Fix another bug in merging of inherited CHECK constraints. 2016-10-13 17:05:14 -04:00
commands Fix incorrect trigger-property updating in ALTER CONSTRAINT. 2016-10-26 17:05:06 -04:00
executor Improve speed of aggregates that use array_append as transition function. 2016-10-30 12:27:41 -04:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Clarify the new Red-Black post-order traversal code a bit. 2016-09-04 15:02:06 +03:00
libpq Consistently mention 'SELECT pg_reload_conf()' in config files 2016-10-25 11:26:15 -04:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Use more efficient hashtable for tidbitmap.c to speed up bitmap scans. 2016-10-14 16:08:11 -07:00
optimizer Don't make FK-based selectivity estimates in inheritance situations. 2016-11-02 15:50:15 -04:00
parser Add ALTER EXTENSION ADD/DROP ACCESS METHOD, and use it in pg_upgrade. 2016-10-02 14:31:28 -04:00
po Translation updates 2016-08-08 11:08:00 -04:00
port Try to find out the actual hugepage size when making a MAP_HUGETLB request. 2016-10-13 15:06:46 -04:00
postmaster If the stats collector dies during Hot Standby, restart it. 2016-10-27 14:27:40 -04:00
regex Make locale-dependent regex character classes work for large char codes. 2016-09-05 17:06:29 -04:00
replication Fix typos in comments. 2016-10-26 11:12:31 +03:00
rewrite Improve parser's and planner's handling of set-returning functions. 2016-09-13 13:54:24 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Add API to check if an existing exclusive lock allows cleanup. 2016-11-04 09:32:24 -04:00
tcop Make getrusage() output a little more readable 2016-10-19 09:53:16 -04:00
tsearch Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
utils Add make rules to download raw Unicode mapping files 2016-11-01 11:54:58 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00