[*] Made WakeOnAddress trigger pointers always const

This commit is contained in:
Reece Wilson 2023-08-19 20:37:24 +01:00
parent 412cdfb28b
commit b236469d06
3 changed files with 12 additions and 12 deletions

View File

@ -9,11 +9,11 @@
namespace Aurora::Threading
{
AUKN_SYM void WakeAllOnAddress(void *pTargetAddress);
AUKN_SYM void WakeAllOnAddress(const void *pTargetAddress);
AUKN_SYM void WakeOnAddress(void *pTargetAddress);
AUKN_SYM void WakeOnAddress(const void *pTargetAddress);
AUKN_SYM void WakeNOnAddress(void *pTargetAddress,
AUKN_SYM void WakeNOnAddress(const void *pTargetAddress,
AuUInt8 uNMaximumThreads);
AUKN_SYM bool TryWaitOnAddress(void *pTargetAddress,

View File

@ -238,7 +238,7 @@ namespace Aurora::Threading
}
}
WaitEntry *ProcessWaitNodeContainer::WaitBufferFrom(void *pAddress, AuUInt8 uSize)
WaitEntry *ProcessWaitNodeContainer::WaitBufferFrom(const void *pAddress, AuUInt8 uSize)
{
#if defined(HACK_NO_INVALID_ACCESS_LEAK_SHARED_REF_ON_DESTROYED_THREAD)
auto pReturn = tlsWaitEntry.get();
@ -334,7 +334,7 @@ namespace Aurora::Threading
this->uAtomic = 0;
}
WaitEntry *ProcessWaitContainer::WaitBufferFrom(void *pAddress, AuUInt8 uSize)
WaitEntry *ProcessWaitContainer::WaitBufferFrom(const void *pAddress, AuUInt8 uSize)
{
#if defined(FALLBACK_WAKEONADDRESS_SUPPORTS_NONEXACT_MATCHING)
auto pAddressIDC = (void *)(AuUInt(pAddress) & ~(8 - 1));
@ -345,7 +345,7 @@ namespace Aurora::Threading
}
template <typename T>
bool ProcessWaitContainer::IterateWake(void *pAddress, T callback)
bool ProcessWaitContainer::IterateWake(const void *pAddress, T callback)
{
#if defined(FALLBACK_WAKEONADDRESS_SUPPORTS_NONEXACT_MATCHING)
auto pAddressIDC = (void *)(AuUInt(pAddress) & ~(8 - 1));
@ -836,7 +836,7 @@ namespace Aurora::Threading
});
}
AUKN_SYM void WakeNOnAddress(void *pTargetAddress,
AUKN_SYM void WakeNOnAddress(const void *pTargetAddress,
AuUInt8 uNMaximumThreads)
{
if (IsWaitOnRecommended())
@ -865,12 +865,12 @@ namespace Aurora::Threading
}
}
AUKN_SYM void WakeOnAddress(void *pTargetAddress)
AUKN_SYM void WakeOnAddress(const void *pTargetAddress)
{
WakeNOnAddress(pTargetAddress, 1);
}
AUKN_SYM void WakeAllOnAddress(void *pTargetAddress)
AUKN_SYM void WakeAllOnAddress(const void *pTargetAddress)
{
if (IsWaitOnRecommended())
{

View File

@ -79,7 +79,7 @@ namespace Aurora::Threading
#endif
ProcessListWait waitList;
WaitEntry *WaitBufferFrom(void *pAddress, AuUInt8 uSize);
WaitEntry *WaitBufferFrom(const void *pAddress, AuUInt8 uSize);
template <typename T>
bool IterateWake(T callback);
@ -93,9 +93,9 @@ namespace Aurora::Threading
{
ProcessWaitNodeContainer list[kDefaultWaitPerProcess];
WaitEntry *WaitBufferFrom(void *pAddress, AuUInt8 uSize);
WaitEntry *WaitBufferFrom(const void *pAddress, AuUInt8 uSize);
template <typename T>
bool IterateWake(void *pAddress, T callback);
bool IterateWake(const void *pAddress, T callback);
};
}