2021-11-05 17:34:23 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: ThreadState.hpp
|
|
|
|
Date: 2021-11-1
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2023-12-07 09:20:23 +00:00
|
|
|
#include "IThreadPoolInternal.hpp"
|
2023-11-11 10:11:09 +00:00
|
|
|
#include "AuThreadState.hpp"
|
|
|
|
#include "AuGroupWorkQueue.hpp"
|
2021-11-05 17:34:23 +00:00
|
|
|
|
|
|
|
namespace Aurora::Async
|
|
|
|
{
|
|
|
|
struct GroupState;
|
2022-03-10 15:35:01 +00:00
|
|
|
struct AsyncLoop;
|
2021-11-05 17:34:23 +00:00
|
|
|
|
2023-11-11 10:11:09 +00:00
|
|
|
struct ThreadState : ThreadStateBase
|
2021-11-05 17:34:23 +00:00
|
|
|
{
|
2023-11-11 11:27:01 +00:00
|
|
|
ThreadState() :
|
|
|
|
running(true, false, true),
|
2023-06-07 19:35:31 +00:00
|
|
|
isDeadEvent(false, false, true)
|
2023-11-11 11:27:01 +00:00
|
|
|
{ }
|
2023-05-25 00:55:55 +00:00
|
|
|
|
|
|
|
// :vomit:
|
2023-12-26 21:01:29 +00:00
|
|
|
AuSemaphore syncSema;
|
|
|
|
AuEvent isDeadEvent;
|
2021-11-05 17:34:23 +00:00
|
|
|
bool exiting {};
|
|
|
|
bool shuttingdown {};
|
2023-01-30 14:32:26 +00:00
|
|
|
bool exitingflag2 {};
|
2023-05-25 00:55:55 +00:00
|
|
|
AuThreadPrimitives::Event running;
|
2024-09-05 05:38:16 +00:00
|
|
|
AuListOfHeap<WorkEntry_t> pendingWorkItems;
|
2023-02-08 18:23:37 +00:00
|
|
|
bool bAlreadyDoingExitTick {};
|
2023-01-30 14:32:26 +00:00
|
|
|
AuThreadPrimitives::SpinLock externalFencesLock;
|
|
|
|
AuList<AuThreading::IWaitable *> externalFences;
|
2021-11-05 17:34:23 +00:00
|
|
|
};
|
|
|
|
}
|