[*] i want every bit of performance i can squeeze out of old windows operating systems

This commit is contained in:
Reece Wilson 2023-05-08 15:16:06 +01:00
parent 08f790c3af
commit a2cfb7765b
2 changed files with 21 additions and 1 deletions

View File

@ -49,6 +49,8 @@ namespace Aurora::IO::TLS
static thread_local bool tlsHackIsMainThread {};
static void Pump();
static void Init()
{
Aurora::InitProcAddresses();
@ -87,6 +89,8 @@ static void Init()
Aurora::Hashing::InitHashing();
Aurora::Async::InitAsync();
gRuntimeRunLevel = 2;
Pump();
}
static void Pump()
@ -98,7 +102,13 @@ static void Pump()
#endif
#if defined(AURORA_PLATFORM_WIN32)
::timeBeginPeriod(1);
if (!AuSwInfo::IsWindows8Point1OrGreater())
{
if (::timeBeginPeriod(0) == TIMERR_NOCANDO)
{
::timeBeginPeriod(1);
}
}
#endif
}

View File

@ -8,6 +8,9 @@
#include <Source/RuntimeInternal.hpp>
#include "AuWakeOnAddress.hpp"
#include "Primitives/SMTYield.hpp"
#if defined(AURORA_PLATFORM_WIN32)
#include <timeapi.h>
#endif
namespace Aurora::Threading
{
@ -133,6 +136,13 @@ namespace Aurora::Threading
#else
#if defined(AURORA_PLATFORM_WIN32)
if (::timeBeginPeriod(0) == TIMERR_NOCANDO)
{
::timeBeginPeriod(1);
}
#endif
this->variable.WaitForSignalNS(uTimeRemNS);
#endif