[*] Win32: Delegate last nights hack before bed to grug
(unix parity)
This commit is contained in:
parent
76069f2b43
commit
cb920e1ee1
@ -155,6 +155,19 @@ namespace Aurora::Exit
|
||||
}
|
||||
|
||||
#if defined(AURORA_PLATFORM_WIN32)
|
||||
|
||||
static void SendExitSignal(Grug::Arrow *)
|
||||
{
|
||||
PostLevel(AuThreads::GetThread(), Exit::ETriggerLevel::eSigTerminate);
|
||||
}
|
||||
|
||||
static void SendTerminateSignalAndBlock()
|
||||
{
|
||||
static Grug::Arrow arrow;
|
||||
Grug::HurlArrow(&arrow, SendExitSignal, {});
|
||||
Grug::ArrowWait(&arrow);
|
||||
}
|
||||
|
||||
BOOL Win32BasicHandler(DWORD ctrlType)
|
||||
{
|
||||
if (ctrlType == CTRL_C_EVENT ||
|
||||
@ -162,7 +175,7 @@ namespace Aurora::Exit
|
||||
ctrlType == CTRL_SHUTDOWN_EVENT)
|
||||
{
|
||||
Exit::gHasCanceled = false;
|
||||
Exit::PostLevel(AuThreads::GetThread(), Exit::ETriggerLevel::eSigTerminate);
|
||||
SendTerminateSignalAndBlock();
|
||||
return !AuExchange(Exit::gHasCanceled, false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user