[*] Disable telemetry reporting after runtime shutdown to prevent null exceptions from being reported under TLS. Fixes deadlock and a crash.
This commit is contained in:
parent
a1e77a471b
commit
15c7df1480
@ -15,6 +15,7 @@ namespace Aurora::Grug
|
||||
{
|
||||
static AuList<Arrow *> gReservedArrows; // stacks are slower than vectors under msvc, 'twas a qst bottleneck
|
||||
static AuThreadPrimitives::SpinLock gSpinLock;
|
||||
static bool gDisableGrugMessages {};
|
||||
|
||||
void SignalSafeSleepLockYield(AuThreadPrimitives::SpinLock &lock)
|
||||
{
|
||||
@ -30,6 +31,11 @@ namespace Aurora::Grug
|
||||
|
||||
void HurlArrow(Arrow *pArrow, GrugReport_f pCallback, GrugReport_f pCallbackRunaway)
|
||||
{
|
||||
if (gDisableGrugMessages)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pArrow->pCallback = pCallback;
|
||||
pArrow->pCallbackRunaway = pCallbackRunaway;
|
||||
|
||||
@ -54,6 +60,11 @@ namespace Aurora::Grug
|
||||
|
||||
void ArrowWait(Arrow *arrow)
|
||||
{
|
||||
if (gDisableGrugMessages)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AU_LOCK_GUARD(arrow->spinSemaphore);
|
||||
}
|
||||
|
||||
@ -131,4 +142,9 @@ namespace Aurora::Grug
|
||||
{
|
||||
gReservedArrows.reserve(20);
|
||||
}
|
||||
|
||||
void DeinitArrows()
|
||||
{
|
||||
gDisableGrugMessages = true;
|
||||
}
|
||||
}
|
@ -28,4 +28,5 @@ namespace Aurora::Grug
|
||||
void HurlFatalEvent(Arrow *pArrow);
|
||||
|
||||
void DequeueOneArrow();
|
||||
void DeinitArrows();
|
||||
}
|
@ -156,6 +156,8 @@ namespace Aurora::Grug
|
||||
gMutex.reset();
|
||||
gCondVar.reset();
|
||||
gArrows.reset();
|
||||
|
||||
DeinitArrows();
|
||||
}
|
||||
|
||||
void NotifyGrugOfTelemetry()
|
||||
|
Loading…
Reference in New Issue
Block a user