2023-12-28 16:49:11 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: CompletionGroupAndedIOWorkItem.cpp
|
|
|
|
Date: 2023-12-28
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#include <Source/RuntimeInternal.hpp>
|
|
|
|
#include <Aurora/IO/IOExperimental.hpp>
|
|
|
|
#include "CompletionGroup.hpp"
|
|
|
|
#include "CompletionGroupAndedIOWorkItem.hpp"
|
|
|
|
|
|
|
|
namespace Aurora::IO::CompletionGroup
|
|
|
|
{
|
|
|
|
CompletionGroupAndedIOWorkItem::CompletionGroupAndedIOWorkItem(Async::IThreadPoolInternal *owner,
|
|
|
|
const AuWorkerID &worker,
|
|
|
|
AuSPtr<CompletionGroup> pParent) :
|
|
|
|
Async::WorkItem(owner, worker, nullptr),
|
|
|
|
pParent(pParent)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CompletionGroupAndedIOWorkItem::DispatchTask(Async::IWorkItemHandler::ProcessInfo &info)
|
|
|
|
{
|
2024-01-11 12:19:54 +00:00
|
|
|
this->pParent->DoIOTick(false);
|
2023-12-28 16:49:11 +00:00
|
|
|
|
|
|
|
if (this->pParent->HasItemsActive())
|
|
|
|
{
|
|
|
|
info = AuAsync::ETickType::eSchedule;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|