Acquire an exclusive write lock. See :meth:`ReadWriteLock.acquire_write` for full semantics. :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is u
(self, timeout: float = -1, *, blocking: bool = True)
| 186 | return AsyncAcquireReadWriteReturnProxy(lock=self) |
| 187 | |
| 188 | async def acquire_write(self, timeout: float = -1, *, blocking: bool = True) -> AsyncAcquireReadWriteReturnProxy: |
| 189 | """ |
| 190 | Acquire an exclusive write lock. |
| 191 | |
| 192 | See :meth:`ReadWriteLock.acquire_write` for full semantics. |
| 193 | |
| 194 | :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely |
| 195 | :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable |
| 196 | |
| 197 | :returns: a proxy that can be used as an async context manager to release the lock |
| 198 | |
| 199 | :raises RuntimeError: if a read lock is already held, or a write lock is held by a different thread |
| 200 | :raises Timeout: if the lock cannot be acquired within *timeout* seconds |
| 201 | |
| 202 | """ |
| 203 | self._raise_if_unusable() |
| 204 | await self._run_acquire(functools.partial(self._lock.acquire_write, timeout, blocking=blocking)) |
| 205 | return AsyncAcquireReadWriteReturnProxy(lock=self) |
| 206 | |
| 207 | async def release(self, *, force: bool = False) -> None: |
| 208 | """ |