pub const Lock = struct manifest_file: Io.File307
308
309
310
311
312
313
314
315
316
317
318
319
320pub const Lock = struct {
manifest_file: Io.File,
pub fn release(lock: *Lock, io: Io) 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(io);
}
lock.manifest_file.close(io);
lock.* = undefined;
}
}