AuroraRuntime/Source/Grug/AuArrow.hpp

31 lines
756 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuArrow.hpp
Date: 2022-02-03
Author: Reece
***/
#pragma once
namespace Aurora::Grug
{
struct Arrow;
using GrugReport_f = void(*)(Arrow *);
struct Arrow
{
AuThreadPrimitives::SpinLock spinSemaphore;
bool bPermitRunAhead;
GrugThread thread;
GrugReport_f pCallback;
GrugReport_f pCallbackRunaway;
};
void HurlArrow(Arrow *pArrow, GrugReport_f pCallback, GrugReport_f pCallbackRunaway);
void ArrowWait(Arrow *pArrow);
void ArrowThreadAsyncSafe(Arrow *pArrow);
void HurlRaiseProblematicEvent(Arrow *pArrow);
void HurlFatalEvent(Arrow *pArrow);
void DequeueOneArrow();
}