r5sdk/r5dev/tier0/threadtools.cpp
Kawe Mazidjatari 86c9ac5292 Upgrade mathlib to latest
Latest SourceSDK MathLib with minor modifications.
2022-07-08 00:55:01 +02:00

31 lines
939 B
C++
Raw Blame History

//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose: Random number generator
//
// $Workfile: $
// $NoKeywords: $
//===========================================================================//
#include "core/stdafx.h"
#include "threadtools.h"
LONG ThreadInterlockedCompareExchange64(LONG volatile* pDest, int64 value, int64 comperand)
{
return _InterlockedCompareExchange(pDest, comperand, value);
}
bool ThreadInterlockedAssignIf(LONG volatile* p, int32 value, int32 comperand)
{
Assert((size_t)p % 4 == 0);
return _InterlockedCompareExchange(p, comperand, value);
}
int64 ThreadInterlockedCompareExchange64(int64 volatile* pDest, int64 value, int64 comperand)
{
return _InterlockedCompareExchange64(pDest, comperand, value);
}
bool ThreadInterlockedAssignIf64(int64 volatile* pDest, int64 value, int64 comperand)
{
return _InterlockedCompareExchange64(pDest, comperand, value);
}