MCPcopy Create free account

hub / github.com/tox-dev/filelock / functions

Functions1,605 in github.com/tox-dev/filelock

↓ 321 callersMethodacquire
Try to acquire the file lock. :param timeout: maximum wait time for acquiring the lock, ``None`` means use the default :attr:`~timeo
src/filelock/_api.py:983
↓ 214 callersMethodrelease
Release the file lock. The lock is only completely released when the lock counter reaches 0. The lock file itself may be deleted auto
src/filelock/_api.py:1099
↓ 117 callersMethodclose
Release the lock (if held) and close the underlying SQLite connection. After calling this method, the lock instance is no longer usa
src/filelock/_read_write.py:428
↓ 73 callersMethodjoin
(self, timeout: float | None = None)
tests/test_filelock.py:281
↓ 42 callersMethodacquire_write
Acquire an exclusive write lock. If this instance already holds a write lock from the same thread, the lock level is incremented (re
src/filelock/_read_write.py:348
↓ 40 callersMethodrun
(self)
tests/test_filelock.py:275
↓ 35 callersFunction_make_lock
( path: str, *, heartbeat_interval: float = 0.1, stale_threshold: float = 0.5, poll_interv
tests/soft_rw/test_soft_rw_sync.py:1056
↓ 33 callersMethodcancel
(self, msg: object | None = None)
tests/test_async_filelock_runner_shutdown.py:41
↓ 29 callersMethodacquire_read
Acquire a shared read lock. If this instance already holds a read lock, the lock level is incremented (reentrant). Attempting to acq
src/filelock/_read_write.py:330
↓ 26 callersMethodclose
Release any held lock and release internal filesystem resources. Idempotent. After calling this method the instance can no longer ac
src/filelock/_soft_rw/_sync.py:335
↓ 25 callersFunction_initialize_protocol
(lock_path: Path)
tests/test_strict_soft_failures.py:954
↓ 25 callersFunctioncleanup_processes
Reap every process on the way out, whatever the block did.
tests/process_helpers.py:15
↓ 25 callersMethodwrite_lock
Context manager that acquires and releases an exclusive write lock. Falls back to instance defaults for *timeout* and *blocking* whe
src/filelock/_read_write.py:390
↓ 24 callersMethodclose
Release the lock (if held) and close the underlying SQLite connection. After calling this method, the lock instance is no longer usa
src/filelock/_async_read_write.py:223
↓ 23 callersMethodrelease
Release one level of the current lock. When the lock level reaches zero the underlying SQLite transaction is rolled back, releasing
src/filelock/_read_write.py:410
↓ 22 callersFunction_lease
( marker: Path, *, lease_duration: float = _DURATION, timeout: float = 0.3, on_compromise:
tests/test_soft_lease.py:44
↓ 20 callersMethodread_lock
Context manager that acquires and releases a shared read lock. Falls back to instance defaults for *timeout* and *blocking* when ``N
src/filelock/_read_write.py:369
↓ 18 callersFunction_fork_transition
(descriptor_owner: _ForkDescriptorOwner | None = None)
src/filelock/_api.py:1565
↓ 18 callersMethodrelease
Release one level of the current lock. See :meth:`ReadWriteLock.release` for full semantics. :param force: if ``True``, rel
src/filelock/_async_read_write.py:207
↓ 17 callersFunction_holder
(pid: int, *, host: str = _HOST, start: int | None = None)
tests/test_soft_stale.py:45
↓ 17 callersFunctionassert_file_lock_state
(lock_file: str, *, available: bool)
tests/async_filelock_cancellation_helpers.py:32
↓ 17 callersFunctionprocess_start_token
The process creation FILETIME as a 100ns tick count, or ``None`` when it cannot be read.
src/filelock/_identity.py:88
↓ 15 callersFunctionhost_name
The hostname recorded alongside an owner, so a marker written on another machine is never probed here. Marker formats here hold the field to
src/filelock/_identity.py:16
↓ 13 callersFunction_assert_times_out
(lock_path: Path, *, timeout: float = 0.1)
tests/test_soft_stale.py:384
↓ 13 callersFunction_ensure_current_process
()
src/filelock/_api.py:1672
↓ 13 callersFunction_make
( tmp_path: Path, name: str = "foo.lock", *, timeout: float = -1, blocking: bool = True,
tests/soft_rw/test_soft_rw_async.py:32
↓ 13 callersFunctionfork_process
(child: Callable[[], NoReturn] | None = None)
tests/fork_helpers.py:30
↓ 13 callersMethodrelease
Release one level of the current lock. When the lock level reaches zero the heartbeat thread is stopped and the held marker file is
src/filelock/_soft_rw/_sync.py:358
↓ 12 callersFunction_raise_cleanup_errors
( message: str, primary_error: BaseException, *cleanup_errors: BaseException | None, )
src/filelock/_api.py:296
↓ 11 callersFunction_drain_future
(future: asyncio.Future[_BackendOutcome[_T]])
src/filelock/_async.py:113
↓ 11 callersFunction_run_fork_script
(script: str, arguments: list[str], *, timeout: float)
tests/test_read_write_fork.py:307
↓ 11 callersFunctionacquire
()
tests/test_filelock.py:2235
↓ 11 callersFunctionlock_descriptor
Take the native OS lock on *fd*, a file descriptor the caller opened and owns. This is the same one-byte exclusive lock :class:`FileLock` us
src/filelock/_descriptor.py:16
↓ 10 callersMethodacquire_write
Acquire an exclusive write lock. See :meth:`ReadWriteLock.acquire_write` for full semantics. :param timeout: maximum wait t
src/filelock/_async_read_write.py:188
↓ 10 callersMethodacquire_write
Acquire an exclusive write lock. If this instance already holds a write lock from the same thread, the lock level is incremented (re
src/filelock/_soft_rw/_sync.py:286
↓ 10 callersFunctionassert_read_write_lock_state
(lock_file: str, mode: Literal["read", "write"], *, available: bool)
tests/read_write_helpers.py:12
↓ 10 callersMethodforce_break
Remove one named claim, allowing overlap if its owner still holds the protected resource.
src/filelock/_strict.py:203
↓ 9 callersFunction_exception_group_cls
()
src/filelock/_api.py:101
↓ 9 callersMethod_mark_descriptor_released
(self)
src/filelock/_api.py:1146
↓ 9 callersFunction_raise_grouped_errors
( message: str, first_error: BaseException, second_error: BaseException, *additional_errors: B
src/filelock/_api.py:114
↓ 9 callersFunction_wait_until_done
(future: asyncio.Future[_T])
src/filelock/_async.py:120
↓ 9 callersFunctionassert_cancellation_message
(error: asyncio.CancelledError, message: str)
tests/async_filelock_cancellation_helpers.py:23
↓ 9 callersFunctionbreak_lock_file
Atomically break a stale lock file judged stale at modification time *mtime_before*. Rename the file to a process-private name before unlink
src/filelock/_util.py:75
↓ 9 callersFunctionexit_child
(status: int)
tests/fork_helpers.py:40
↓ 9 callersFunctiontimeout_for_sqlite
(timeout: float, *, blocking: bool, already_waited: float)
src/filelock/_read_write.py:754
↓ 8 callersFunction_assert_self_heals
(lock_path: Path)
tests/test_soft_stale.py:378
↓ 8 callersFunction_fork_descriptor_probe
( # pragma: needs fork descriptor: int, stat_descriptor: Callable[[int], os.stat_result] )
tests/test_fork_backends.py:502
↓ 8 callersFunction_future_result
(future: asyncio.Future[_BackendOutcome[_T]])
src/filelock/_async.py:125
↓ 8 callersFunctionowner_is_stale
Whether the recorded owner is provably gone, so reclaiming its marker cannot detach a live holder. Fail closed: return ``True`` only when th
src/filelock/_identity.py:37
↓ 8 callersFunctionraise_on_not_writable_file
Raise an exception if attempting to open the file for writing would fail. Separates files that can never be written from files that are writ
src/filelock/_util.py:33
↓ 8 callersFunctionunlock_descriptor
Release the native OS lock on *fd* without touching the descriptor. :param fd: the descriptor a prior :func:`lock_descriptor` locked; the ca
src/filelock/_descriptor.py:53
↓ 7 callersFunction_close_after_commit
(mocker: MockerFixture, lock: SoftFileLock)
tests/test_soft_stale.py:645
↓ 7 callersFunction_error_details
(group: BaseExceptionGroup)
tests/test_fork_backends.py:498
↓ 7 callersFunctionassert_mode_held
(lock_file: str, mode: Literal["read", "write"])
tests/test_async_read_write.py:291
↓ 6 callersFunction_append_exception_context
(error: BaseException, context: BaseException)
src/filelock/_api.py:192
↓ 6 callersMethod_open_mode
Mode for ``os.open``: 0o666 when unset so umask and ACLs decide, otherwise the explicit mode.
src/filelock/_api.py:921
↓ 6 callersFunction_register_fork_object
(instance: _ForkResettable)
src/filelock/_api.py:1579
↓ 6 callersFunction_sqlite_transition
()
src/filelock/_read_write.py:736
↓ 6 callersMethod_start_tracked_release
(self)
src/filelock/asyncio.py:520
↓ 6 callersMethodacquire_read
Acquire a shared read lock. See :meth:`ReadWriteLock.acquire_read` for full semantics. :param timeout: maximum wait time in
src/filelock/_async_read_write.py:169
↓ 6 callersMethodacquire_read
Acquire a shared read lock. If this instance already holds a read lock, the lock level is incremented (reentrant). Attempting to acq
src/filelock/_soft_rw/_sync.py:263
↓ 5 callersFunction_canonical
Return one stable key for *path*, collapsing equivalent spellings without following a final symlink. Relative, absolute, and ``./`` spelling
src/filelock/_api.py:313
↓ 5 callersFunction_close_after_commit
(mocker: MockerFixture, lock: AsyncSoftFileLock)
tests/test_async_filelock.py:769
↓ 5 callersMethod_close_released_fd
(self, fd: int, *, default_suppresses: bool)
src/filelock/_api.py:771
↓ 5 callersFunction_fail_close_of
(mocker: MockerFixture, lock: BaseFileLock, error: OSError)
tests/test_filelock.py:1881
↓ 5 callersFunction_file_identity
(st: os.stat_result)
src/filelock/_soft.py:206
↓ 5 callersFunction_initialize_protocol
(lock_path: Path)
tests/test_strict_soft_races.py:302
↓ 5 callersFunction_join_threads
(*threads: threading.Thread)
tests/test_strict_soft_races.py:307
↓ 5 callersMethod_mark_descriptor_owned
(self, fd: int, identity: tuple[int, int] | None = None)
src/filelock/_api.py:1136
↓ 5 callersFunction_private_claim_path
(lock_path: Path, token: str)
tests/test_strict_soft_failures.py:959
↓ 5 callersFunction_raise_cancelled_error
(cancellation: asyncio.CancelledError, error: BaseException)
src/filelock/_async.py:144
↓ 5 callersFunction_raise_chained_errors
(first_error: BaseException, second_error: BaseException | None = None)
src/filelock/_api.py:246
↓ 5 callersFunction_read_lock_file
(path: str)
src/filelock/_soft.py:212
↓ 5 callersFunction_unlink
(name: str, *, dir_fd: int | None = None)
src/filelock/_soft_rw/_sync.py:841
↓ 5 callersFunction_write_held_claim
(claims: Path)
tests/test_strict_soft_failures.py:879
↓ 5 callersFunctionensure_directory_exists
Ensure the directory containing the file exists (create it if necessary). :param filename: file.
src/filelock/_util.py:65
↓ 5 callersFunctionprocess_alive
Whether a process with this PID exists, treating an access denial as proof it does.
src/filelock/_identity.py:80
↓ 5 callersMethodread_lock
Async context manager that acquires and releases a shared read lock. Falls back to instance defaults for *timeout* and *blocking* wh
src/filelock/_async_read_write.py:112
↓ 4 callersMethod__init__
(self, lock_file: str, *, marker: int = 0)
tests/test_subclass_options.py:334
↓ 4 callersMethod__init__
(self, target: Callable[[], None], name: str)
tests/test_filelock.py:271
↓ 4 callersFunction_file_identity
(st: os.stat_result)
src/filelock/_strict.py:866
↓ 4 callersMethod_finish_connection
(self)
src/filelock/_read_write.py:653
↓ 4 callersFunction_fork_process
( # pragma: needs fork target: Callable[..., object], args: tuple[object, ...] = () )
tests/soft_rw/test_soft_rw_sync.py:1210
↓ 4 callersFunction_patch_async_connection
( mocker: MockerFixture, *, executescript: Callable[[sqlite3.Connection, str], sqlite3.Cursor] | N
tests/test_async_read_write_cancellation.py:469
↓ 4 callersFunction_raise_body_and_release
(body_error: BaseException, release_error: BaseException)
src/filelock/_api.py:288
↓ 4 callersMethod_raise_if_inherited
(self)
src/filelock/_api.py:1131
↓ 4 callersMethod_register_context_descriptor
(self)
src/filelock/_api.py:1342
↓ 4 callersFunction_register_fork_class
(cls: _ForkResettableClass)
src/filelock/_api.py:1587
↓ 4 callersMethod_register_unverified_context_descriptor
(self)
src/filelock/_api.py:1349
↓ 4 callersMethod_release_with_fork_tracking
(self)
src/filelock/_api.py:1335
↓ 4 callersMethodget_lock
Return the singleton :class:`ReadWriteLock` for *lock_file*. :param lock_file: path to the SQLite database file used as the lock
src/filelock/_read_write.py:283
↓ 4 callersMethodhold
(self)
src/filelock/_async.py:37
↓ 4 callersMethodis_thread_local
:returns: a flag indicating if this lock is thread local or not
src/filelock/_api.py:737
↓ 4 callersMethodresume
(self)
tests/soft_rw/test_soft_rw_async.py:86
↓ 4 callersFunctionwrite_all
Write the whole buffer to *fd*, looping over the short writes ``os.write`` is allowed to make. A marker written with a bare ``os.write`` can
src/filelock/_util.py:12
↓ 4 callersMethodwrite_lock
Async context manager that acquires and releases an exclusive write lock. Falls back to instance defaults for *timeout* and *blockin
src/filelock/_async_read_write.py:137
↓ 3 callersFunction_break_stale_marker
( # ruff:ignore[too-many-return-statements] # each return is a distinct abort/commit point in the break prot
src/filelock/_soft_rw/_sync.py:850
↓ 3 callersMethod_claim_writer_marker
(self, token: str)
src/filelock/_soft_rw/_sync.py:553
↓ 3 callersMethod_commit_acquire
Record this instance as the holder once the first acquire succeeds, so peers can detect the deadlock.
src/filelock/_api.py:1367
↓ 3 callersMethod_commit_release
Record the lock as fully released: reset the recursion counter and drop the deadlock-registry entry.
src/filelock/_api.py:1382
next →1–100 of 1,605, ranked by callers