AuroraRuntime/Source/Async/ThreadState.hpp

38 lines
921 B
C++

/***
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;
struct AsyncLoop;
struct ThreadState : ThreadStateBase
{
ThreadState() :
running(true, false, true),
isDeadEvent(false, false, true)
{ }
// :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;
};
}