Jamie Reece Wilson
8944d8bd16
[+] IAsyncTimerCallback [+] ETickType.hpp [+] EWorkPriority.hpp [+] static IThreadPool::GetSelfIOProcessor() [+] static IThreadPool::GetSelfIONetInterface() [+] static IThreadPool::GetSelfIONetWorker() [-] [Source/Async/]AsyncRunnable.hpp [*] Begin encapsulating WorkerPId_t [*] WorkerPId_t no longer take strong pointers to prevent leaks given that these identifiers are copied and kept alive everywhere
31 lines
746 B
C++
31 lines
746 B
C++
/***
|
|
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AuGroupWorkQueue.hpp
|
|
Date: 2023-11-04
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::Async
|
|
{
|
|
struct IAsyncRunnable;
|
|
struct ThreadPool;
|
|
struct ThreadState;
|
|
|
|
using WorkEntry_t = AuPair<ThreadId_t, AuSPtr<IAsyncRunnable>>;
|
|
|
|
struct GroupWorkQueue
|
|
{
|
|
AuMutex mutex;
|
|
AuUInt32 uItems {};
|
|
AuList<WorkEntry_t> sortedWork[AuAsync::kEWorkPriorityCount];
|
|
|
|
bool IsEmpty();
|
|
bool IsEmpty(ThreadPool *pPool, AuWorkerId_t id);
|
|
|
|
void AddWorkEntry(ThreadState *pState, WorkEntry_t entry);
|
|
|
|
void Dequeue(AuList<WorkEntry_t> &queue, int maxPopCount, AuAsync::ThreadId_t idd);
|
|
};
|
|
} |