Temporary workaround for #11933 on Cygwin

Without the sleep, `flock` sometimes returns an error 14 "bad addr".
This puts the application into a deadlock.
This commit is contained in:
Nahor
2025-10-19 12:11:59 -07:00
committed by Johannes Altmanninger
parent 804bda5ba6
commit 372a65aa15

View File

@@ -151,6 +151,10 @@ pub fn new(locking_mode: LockingMode, file_path: &wstr) -> std::io::Result<Self>
return Err(err);
}
}
#[cfg(cygwin)]
// Prevents error 14 "Bad Addr" on Windows (#11933). If the error happens
// the process appears deadlocked
std::thread::sleep(std::time::Duration::from_nanos(1));
// Open the data file
let data_file = wopen_cloexec(file_path, locking_mode.file_flags(), LOCKED_FILE_MODE)?;