postgres/src
Andres Freund f8d7f29b3e Allow lwlocks to be disowned
To implement AIO writes, the backend initiating writes needs to transfer the
lock ownership to the AIO subsystem, so the lock held during the write can be
released in another backend.

Other backends need to be able to "complete" an asynchronously started IO to
avoid deadlocks (consider e.g. one backend starting IO for a buffer and then
waiting for a heavyweight lock held by another relation followed by the
current holder of the heavyweight lock waiting for the IO to complete).

To that end, this commit adds LWLockDisown() and LWLockReleaseDisowned(). If
code uses LWLockDisown() it's the code's responsibility to ensure that the
lock is released in case of errors.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/1f6b50a7-38ef-4d87-8246-786d39f46ab9@iki.fi
2025-02-21 20:55:23 -05:00
..
backend Allow lwlocks to be disowned 2025-02-21 20:55:23 -05:00
bin Add test 005_char_signedness.pl to meson.build. 2025-02-21 12:31:16 -08:00
common Remove various unnecessary (char *) casts 2025-02-20 19:49:27 +01:00
fe_utils In fmtIdEnc(), handle failure of enlargePQExpBuffer(). 2025-02-16 12:46:35 -05:00
include Allow lwlocks to be disowned 2025-02-21 20:55:23 -05:00
interfaces Remove various unnecessary (char *) casts 2025-02-20 19:49:27 +01:00
makefiles Add support for OAUTHBEARER SASL mechanism 2025-02-20 16:25:17 +01:00
pl Allow extension functions to participate in in-place updates. 2025-02-11 12:49:34 -05:00
port Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Adjust EXPLAIN test case to filter out "Actual Rows" values. 2025-02-21 19:20:41 -05:00
timezone Update time zone data files to tzdata release 2025a. 2025-01-20 16:49:15 -05:00
tools Ignore blank lines in pgindent exclude files 2025-02-20 11:36:07 -05:00
tutorial Doc: simplify the tutorial's window-function examples. 2025-01-21 14:43:21 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Add support for OAUTHBEARER SASL mechanism 2025-02-20 16:25:17 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00