[*] Harden awaiting unlock via RuntimeWaitForSecondaryTick() usage under linux

This commit is contained in:
Reece Wilson 2024-07-03 20:07:59 +01:00
parent cb69a7e737
commit 937016e9f3

View File

@ -248,9 +248,14 @@ namespace Aurora::IO
if (!FS::ApplyDumbAdvisoryLock(iFileDescriptor, create.eAdvisoryLevel))
{
SysPushErrorIO("Couldn't open file: {}. File node (not section) is locked.", path);
::close(iFileDescriptor);
return false;
RuntimeWaitForSecondaryTick();
if (!FS::ApplyDumbAdvisoryLock(iFileDescriptor, create.eAdvisoryLevel))
{
SysPushErrorIO("Couldn't open file: {}. File node (not section) is locked.", path);
::close(iFileDescriptor);
return false;
}
}
if (create.bFailIfNonEmptyFile)
@ -288,7 +293,6 @@ namespace Aurora::IO
this->bFlushOnClose = create.bFlushOnClose;
this->path = create.path;
return this->IsValid();
}