AuroraRuntime/Source/Async/ThreadState.hpp

38 lines
945 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 "AsyncRunnable.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:
AuThreadPrimitives::Semaphore syncSema;
AuThreadPrimitives::Event isDeadEvent;
bool exiting {};
bool shuttingdown {};
bool exitingflag2 {};
AuThreadPrimitives::Event running;
AuList<WorkEntry_t> pendingWorkItems;
bool bAlreadyDoingExitTick {};
AuThreadPrimitives::SpinLock externalFencesLock;
AuList<AuThreading::IWaitable *> externalFences;
};
}