structstd.Build.Cache.Lock[src]

Fields

manifest_file: fs.File

Functions

Functionrelease[src]

pub fn release(lock: *Lock) void

Parameters

lock: *Lock

Source Code

Source code
pub fn release(lock: *Lock) void {
    if (builtin.os.tag == .windows) {
        // Windows does not guarantee that locks are immediately unlocked when
        // the file handle is closed. See LockFileEx documentation.
        lock.manifest_file.unlock();
    }

    lock.manifest_file.close();
    lock.* = undefined;
}

Source Code

Source code
pub const Lock = struct {
    manifest_file: fs.File,

    pub fn release(lock: *Lock) void {
        if (builtin.os.tag == .windows) {
            // Windows does not guarantee that locks are immediately unlocked when
            // the file handle is closed. See LockFileEx documentation.
            lock.manifest_file.unlock();
        }

        lock.manifest_file.close();
        lock.* = undefined;
    }
}