[*] eng-regression: introduce missing RuntimeWaitForSecondaryTick's

This commit is contained in:
Reece Wilson 2024-01-09 05:08:54 +00:00
parent bab44d097a
commit 95adfe127d
3 changed files with 31 additions and 0 deletions

View File

@ -203,6 +203,20 @@ namespace Aurora::IO::FS
OPEN_EXISTING,
0,
0);
if (fileHandle == INVALID_HANDLE_VALUE &&
GetLastError() == ERROR_SHARING_VIOLATION)
{
RuntimeWaitForSecondaryTick();
fileHandle = Win32Open(win32Path.c_str(),
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
false,
OPEN_EXISTING,
0,
0);
}
if (fileHandle == INVALID_HANDLE_VALUE)
{
SysPushErrorIO("Couldn't open handle: {}", path);

View File

@ -67,6 +67,21 @@ namespace Aurora::IO::FS
return false;
}
if (GetLastError() == ERROR_SHARING_VIOLATION)
{
RuntimeWaitForSecondaryTick();
hFile = Win32Open(win32Path.c_str(),
GENERIC_WRITE | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES,
FILE_SHARE_READ | FILE_SHARE_WRITE,
false,
OPEN_EXISTING,
0,
0);
}
}
if (hFile == INVALID_HANDLE_VALUE)
{
SysPushErrorIO("Couldn't open a handle for: {}", path);
return false;
}

View File

@ -45,6 +45,8 @@ namespace Aurora::IO::FS
return false;
}
RuntimeWaitForSecondaryTick();
Stat auStat;
if (!times.accessedNs ||
!times.modifiedNs)