Acquire an exclusive write lock for the current task. :param timeout: seconds to wait, or ``None`` for the instance default :param blocking: wait on contention, or ``None`` for the instance default :returns: an async context manager that releases the lock on exit
(
self, timeout: float | None = None, *, blocking: bool | None = None
)
| 152 | await self._release_in_context(body_error) |
| 153 | |
| 154 | async def acquire_write( |
| 155 | self, timeout: float | None = None, *, blocking: bool | None = None |
| 156 | ) -> AsyncAcquireReadWriteReturnProxy: |
| 157 | """ |
| 158 | Acquire an exclusive write lock for the current task. |
| 159 | |
| 160 | :param timeout: seconds to wait, or ``None`` for the instance default |
| 161 | :param blocking: wait on contention, or ``None`` for the instance default |
| 162 | :returns: an async context manager that releases the lock on exit |
| 163 | :raises RuntimeError: the task already holds the read lock or inherited the wrapper after fork |
| 164 | :raises sqlite3.ProgrammingError: the wrapper is closed |
| 165 | :raises Timeout: the deadline expired |
| 166 | :raises TypeError: timeout is a boolean or not a real number, or blocking is not a boolean |
| 167 | :raises ValueError: a blocking call received NaN or a negative timeout other than -1 |
| 168 | """ |
| 169 | self._raise_if_unusable() |
| 170 | await self._acquire("write", timeout, blocking=blocking) |
| 171 | return AsyncAcquireReadWriteReturnProxy(lock=self) |
| 172 | |
| 173 | @override |
| 174 | def _reset_after_fork_in_child(self) -> None: # pragma: forked child |