Skip to content

FileLock

The state of a scoped File lock.

Passed to the block given to File.lock and File.try_lock.

Fields

held @ Bool

Whether the lock is currently held.

The value is false when try_lock does not acquire the lock, and after releasing it.

Methods

release()

Releases the lock before the surrounding scope exits.

Repeated calls have no effect. Release runs with interruption masked.