AuroraRuntime/Source/Threading/Primitives/AuWoASemaphore.NT.hpp
Jamie Reece Wilson e6c2a5c9de [*] Optimize for legacy 32bit Windows targets "*"
[*] 32bit compilation regressions

*: It's actually worse for Windows Vista and Windows 7. While netbooks of this era should be running 32bit builds to mitigate oversized words, Windows 7 and Vista had decent enough 64bit install bases; XP, Windows 2000, Windows 98, and NT4 are much more relevant 32bit targets
2024-12-27 14:01:36 +00:00

35 lines
824 B
C++

/***
Copyright (C) 2024 Jamie Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuWoASemaphore.NT.cpp
Date: 2024-12-27
Author: Reece
***/
#pragma once
namespace Aurora::Threading::Primitives
{
struct WoASemaphoreImpl final
{
WoASemaphoreImpl(AuUInt16 intialValue = 0);
~WoASemaphoreImpl();
bool HasOSHandle(AuMach &mach);
bool HasLockImplementation();
auline bool TryLockNoSpin();
bool TryLock();
bool LockMS(AuUInt64 timeout);
bool LockNS(AuUInt64 timeout);
void Lock();
void Unlock(AuUInt16 count);
bool LockAbsNS(AuUInt64 qwTimeoutAbs);
void Unlock();
inline WoASemaphoreImpl *operator ->()
{
return this;
}
private:
HANDLE hHandle;
};
}