mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 08:14:48 +00:00
windows: workaround kernel race condition better
Until I can do more testing, we bump the numbers until morale improves.
This commit is contained in:
parent
923ddd94a1
commit
8efcfeaf1e
@ -622,7 +622,7 @@ pub const File = struct {
|
||||
error.AccessDenied => switch (builtin.os.tag) {
|
||||
.windows => {
|
||||
// give the kernel a chance to finish closing the executable handle
|
||||
std.os.windows.kernel32.Sleep(0);
|
||||
std.os.windows.kernel32.Sleep(1);
|
||||
continue;
|
||||
},
|
||||
else => return error.AccessDenied,
|
||||
|
||||
@ -74,7 +74,7 @@ pub fn main() anyerror!void {
|
||||
for (0..2) |_| break tmp.dir.rename("hello.exe", "hello") catch |err| switch (err) {
|
||||
error.AccessDenied => {
|
||||
// give the kernel a chance to finish closing the executable handle
|
||||
std.os.windows.kernel32.Sleep(0);
|
||||
std.os.windows.kernel32.Sleep(1);
|
||||
continue;
|
||||
},
|
||||
else => |e| return e,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user