- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitf8d7f29
committed
Allow lwlocks to be disowned
To implement AIO writes, the backend initiating writes needs to transfer thelock ownership to the AIO subsystem, so the lock held during the write can bereleased in another backend.Other backends need to be able to "complete" an asynchronously started IO toavoid deadlocks (consider e.g. one backend starting IO for a buffer and thenwaiting for a heavyweight lock held by another relation followed by thecurrent holder of the heavyweight lock waiting for the IO to complete).To that end, this commit adds LWLockDisown() and LWLockReleaseDisowned(). Ifcode uses LWLockDisown() it's the code's responsibility to ensure that thelock is released in case of errors.Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://postgr.es/m/1f6b50a7-38ef-4d87-8246-786d39f46ab9@iki.fi1 parent44cbba9 commitf8d7f29
2 files changed
+71
-6
lines changedLines changed: 69 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1775 | 1775 |
| |
1776 | 1776 |
| |
1777 | 1777 |
| |
1778 |
| - | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1779 | 1792 |
| |
1780 |
| - | |
1781 |
| - | |
| 1793 | + | |
| 1794 | + | |
1782 | 1795 |
| |
1783 | 1796 |
| |
1784 |
| - | |
1785 |
| - | |
1786 | 1797 |
| |
1787 | 1798 |
| |
1788 | 1799 |
| |
| |||
1802 | 1813 |
| |
1803 | 1814 |
| |
1804 | 1815 |
| |
1805 |
| - | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
1806 | 1828 |
| |
1807 | 1829 |
| |
1808 | 1830 |
| |
| |||
1840 | 1862 |
| |
1841 | 1863 |
| |
1842 | 1864 |
| |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
1843 | 1897 |
| |
1844 | 1898 |
| |
1845 | 1899 |
| |
1846 | 1900 |
| |
1847 | 1901 |
| |
1848 | 1902 |
| |
1849 | 1903 |
| |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
1850 | 1913 |
| |
1851 | 1914 |
| |
1852 | 1915 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
129 | 129 |
| |
130 | 130 |
| |
131 | 131 |
| |
| 132 | + | |
| 133 | + | |
132 | 134 |
| |
133 | 135 |
| |
134 | 136 |
| |
|
0 commit comments
Comments
(0)