[*] bug: drop limitation in io processor
[*] attempting to mitigate freeze on remote start watch
This commit is contained in:
parent
028c85e4c8
commit
dcb27645a1
@ -76,13 +76,7 @@ namespace Aurora::Async
|
||||
}
|
||||
|
||||
AuAtomicAdd(&pWorker->cvHasWork, 1u);
|
||||
|
||||
pWorker->cvVariable->Broadcast();
|
||||
|
||||
if (auto pEventLS = pWorker->eventLs)
|
||||
{
|
||||
pEventLS->Set();
|
||||
}
|
||||
pWorker->SetEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,10 +160,7 @@ namespace Aurora::Async
|
||||
pWorker->cvVariable->Signal();
|
||||
}
|
||||
|
||||
if (AuAtomicTestAndSet(&pWorker->cvLSActive, 0u) == 0)
|
||||
{
|
||||
pWorker->eventLs->Set();
|
||||
}
|
||||
pWorker->SetEvent(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,6 +75,22 @@ namespace Aurora::Async
|
||||
AuSPtr<AuLoop::ILSEvent> eventLs;
|
||||
AuSPtr<AuLoop::ILoopSource> asyncLoopSourceShared;
|
||||
|
||||
inline void SetEvent(bool bBoth = true)
|
||||
{
|
||||
if (auto pEvent = this->eventLs)
|
||||
{
|
||||
if (AuAtomicTestAndSet(&this->cvLSActive, 0u) == 0)
|
||||
{
|
||||
pEvent->Set();
|
||||
}
|
||||
}
|
||||
|
||||
if (bBoth)
|
||||
{
|
||||
this->cvVariable->Signal();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
AuUInt32 uShutdownFence { 1 };
|
||||
};
|
||||
|
@ -17,7 +17,7 @@ namespace Aurora::Async
|
||||
{
|
||||
if (LoopQueue::Commit())
|
||||
{
|
||||
this->commitPending_ = false;
|
||||
AuAtomicSub(&this->commitPending_, 1u);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -54,11 +54,17 @@ namespace Aurora::Async
|
||||
|
||||
void AsyncLoop::Schedule()
|
||||
{
|
||||
this->commitPending_ = true;
|
||||
|
||||
if (AuThreads::GetThread() != this->pParent->threadObject.get())
|
||||
{
|
||||
this->pParent->cvVariable->Broadcast();
|
||||
AuAtomicAdd(&this->commitPending_, 1u);
|
||||
{
|
||||
AU_LOCK_GUARD(this->pParent->parent.lock()->workQueue.mutex);
|
||||
this->pParent->SetEvent();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->commitPending_ = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,6 @@ namespace Aurora::Async
|
||||
bool CommitPending();
|
||||
|
||||
private:
|
||||
bool commitPending_ {};
|
||||
AuUInt32 commitPending_ {};
|
||||
};
|
||||
}
|
@ -728,11 +728,6 @@ namespace Aurora::IO
|
||||
const AuSPtr<IIOEventListener> &pListener,
|
||||
bool bSingleshot)
|
||||
{
|
||||
if (!CheckThread())
|
||||
{
|
||||
AU_THROW_STRING("Wrong Thread");
|
||||
}
|
||||
|
||||
auto item = AuMakeShared<IOProcessorItem>();
|
||||
if (!item)
|
||||
{
|
||||
|
@ -375,6 +375,7 @@ namespace Aurora::IO::Loop
|
||||
try
|
||||
{
|
||||
AU_DEBUG_MEMCRUNCH;
|
||||
AU_LOCK_GUARD(this->sourceMutex_);
|
||||
|
||||
bool bShouldRebuild {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user