AuroraRuntime/Source/Async/ThreadState.hpp

38 lines
921 B
C++
Raw Permalink Normal View History

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ThreadState.hpp
Date: 2021-11-1
Author: Reece
***/
#pragma once
#include "IThreadPoolInternal.hpp"
#include "AuThreadState.hpp"
#include "AuGroupWorkQueue.hpp"
namespace Aurora::Async
{
struct GroupState;
2022-03-10 15:35:01 +00:00
struct AsyncLoop;
struct ThreadState : ThreadStateBase
{
2023-11-11 11:27:01 +00:00
ThreadState() :
running(true, false, true),
isDeadEvent(false, false, true)
2023-11-11 11:27:01 +00:00
{ }
// :vomit:
AuSemaphore syncSema;
AuEvent isDeadEvent;
bool exiting {};
bool shuttingdown {};
bool exitingflag2 {};
AuThreadPrimitives::Event running;
AuListOfHeap<WorkEntry_t> pendingWorkItems;
bool bAlreadyDoingExitTick {};
AuThreadPrimitives::SpinLock externalFencesLock;
AuList<AuThreading::IWaitable *> externalFences;
};
}