Changed test code in FlmStartup to validate atomic primitives on platforms that require mutexes for atomicity.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@199 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
ahodgkinson
2006-03-17 23:35:55 +00:00
parent 6c89a7432e
commit 0dc23f110a

View File

@@ -623,22 +623,22 @@ FLMEXP RCODE FLMAPI FlmStartup( void)
#if defined( FLM_DEBUG)
#if defined( FLM_HAVE_ATOMICS)
#if !defined( FLM_HAVE_ATOMICS) && (defined( FLM_WIN) || defined( FLM_NLM))
#error Something is wrong with the build environment!
#endif
{
FLMATOMIC atomicVal = 10772;
FLMINT32 i32Tmp;
flmAssert( flmAtomicInc( &atomicVal) == 10773);
flmAssert( flmAtomicDec( &atomicVal) == 10772);
flmAssert( flmAtomicInc( &atomicVal, (F_MUTEX)1, TRUE) == 10773);
flmAssert( flmAtomicDec( &atomicVal, (F_MUTEX)1, TRUE) == 10772);
i32Tmp = flmAtomicExchange( &atomicVal, 10777);
i32Tmp = flmAtomicExchange( &atomicVal, 10777, (F_MUTEX)1, TRUE);
flmAssert( i32Tmp == 10772);
flmAssert( atomicVal == 10777);
}
#elif defined( FLM_WIN) || defined( FLM_NLM)
#error Something is wrong with the build environment!
#endif
#endif