1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 02:51:27 +00:00

Move AtomicAdd/AtomicSet to hsUtils.

This commit is contained in:
Darryl Pogue
2012-03-10 17:49:22 -08:00
parent 26dc1fa120
commit 251cf02bd7
3 changed files with 28 additions and 37 deletions

View File

@ -314,20 +314,3 @@ void CLock::LeaveWrite () {
LeaveSpinLock(&m_spinLock);
}
/****************************************************************************
*
* Exported functions
*
***/
//===========================================================================
long AtomicAdd (long * value, long increment) {
return InterlockedExchangeAdd(value, increment);
}
//===========================================================================
long AtomicSet (long * value, long set) {
return InterlockedExchange(value, set);
}

View File

@ -50,26 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "Pch.h"
/****************************************************************************
*
* Atomic operations
*
***/
// *value += increment; return original value of *value; thread safe
long AtomicAdd (long * value, long increment);
// *value = value; return original value of *value; thread safe
long AtomicSet (long * value, long set);
#define ATOMIC_ONCE(code) { \
static long s_count = 1; \
if (AtomicSet(&s_count, 0)) \
code; \
} //
/****************************************************************************
*
* CLock