silk.system.file_lock.

Exclusive advisory file locks released automatically with their owning handle.

Import as FileLock with import silk.system.file_lock { FileLock }.

Public declarations: 1.

FileLock#

silk
pub struct FileLock

Owns an exclusive advisory lock. Dropping it releases the lock; the lock file remains.

Implementation Drop for FileLock#

silk
impl Drop for FileLock

Operation drop#

silk
fn drop(self: &mut Self) -> ()

Implementation FileLock#

silk
impl FileLock

Associated function exclusive#

silk
pub effect fn exclusive(path: &Path) -> Self ! FileError | OutOfMemoryError ? &mut Allocator

Creates or opens the lock file and waits for its exclusive lock. The parent directory must exist. All participants must lock the same persistent file.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, x86_64-pc-windows-msvc.

View the source of this page