[*] I'm a dumbass. This was accounted for a long ass time ago
This commit is contained in:
parent
bc1296a35c
commit
f8c45613a1
@ -258,16 +258,20 @@ namespace Aurora::IO::FS
|
||||
auto transaction = reinterpret_cast<NtAsyncFileTransaction *>(reinterpret_cast<AuUInt8*>(lpOverlapped) - offsetof(NtAsyncFileTransaction, overlap_));
|
||||
auto hold = AuExchange(transaction->pin_, {});
|
||||
|
||||
SetEvent(lpOverlapped->hEvent);
|
||||
|
||||
if (dwErrorCode)
|
||||
{
|
||||
hold->hasFailed = true;
|
||||
hold->osErrorCode = dwErrorCode;
|
||||
}
|
||||
else if (!hold->lastAbstractStat_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetEvent(lpOverlapped->hEvent);
|
||||
|
||||
hold->lastAbstractStat_ = 0;
|
||||
|
||||
hold->CompleteEx(dwNumberOfBytesTransfered);
|
||||
}
|
||||
|
||||
@ -428,9 +432,6 @@ namespace Aurora::IO::FS
|
||||
|
||||
if (!completeRoutine)
|
||||
{
|
||||
// TODO: only preempt the callback handler if we aren't racing reuse
|
||||
// Could bypass with a while (ioyield()) under such race condition
|
||||
#if 0
|
||||
if (this->GetOSErrorCode() == ERROR_BROKEN_PIPE)
|
||||
{
|
||||
auto pipe = this->ntIpcPipeImpl.lock();
|
||||
@ -448,12 +449,11 @@ namespace Aurora::IO::FS
|
||||
if ((this->hasFailed) ||
|
||||
::GetOverlappedResult(this->handle_->handle, &this->overlap_, &read, false))
|
||||
{
|
||||
this->lastAbstractStat_ = 0;
|
||||
bool bLatched = this->latch_;
|
||||
DispatchCb(read);
|
||||
return this->hasFailed || read;
|
||||
}
|
||||
#endif
|
||||
return this->lastBytes || this->hasFailed;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user