[+] Missing Win32 exit handler. I was dumb enough to rely on the debug exception
[*] ...no this wont do for now
This commit is contained in:
parent
8293484a86
commit
fa9f190635
@ -377,6 +377,7 @@ namespace Aurora::Async
|
||||
|
||||
EarlyExitTick();
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@ -1309,11 +1310,13 @@ namespace Aurora::Async
|
||||
|
||||
if (!this->GetThreadState()->bIsKiller)
|
||||
{
|
||||
AU_LOCK_GUARD(this->rwlock_->AsReadable());
|
||||
#if 0
|
||||
// TODO... i know what to do
|
||||
#else
|
||||
// this will do for now
|
||||
if (!jobWorker->rejecting)
|
||||
if (!jobWorker->rejecting &&
|
||||
!this->shutdown)
|
||||
{
|
||||
this->Barrier(AuAsync::GetCurrentWorkerPId(), 0, false , true);
|
||||
}
|
||||
|
@ -154,6 +154,20 @@ namespace Aurora::Exit
|
||||
gHasCanceled = true;
|
||||
}
|
||||
|
||||
#if defined(AURORA_PLATFORM_WIN32)
|
||||
BOOL Win32BasicHandler(DWORD ctrlType)
|
||||
{
|
||||
if (ctrlType == CTRL_C_EVENT)
|
||||
{
|
||||
Exit::gHasCanceled = false;
|
||||
Exit::PostLevel(AuThreads::GetThread(), Exit::ETriggerLevel::eSigTerminate);
|
||||
return !AuExchange(Exit::gHasCanceled, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void InitExit()
|
||||
{
|
||||
gMutex = AuThreadPrimitives::MutexUnique();
|
||||
@ -162,6 +176,10 @@ namespace Aurora::Exit
|
||||
#if defined(AURORA_IS_POSIX_DERIVED)
|
||||
InitUnix();
|
||||
#endif
|
||||
|
||||
#if defined(AURORA_PLATFORM_WIN32)
|
||||
SetConsoleCtrlHandler((PHANDLER_ROUTINE)Win32BasicHandler, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DeinitExit()
|
||||
|
Loading…
Reference in New Issue
Block a user