nel_misc_mutex_atomic_test_and_set_builtin_gcc.patch

rti, 05/10/2010 09:28 pm

Download (651 Bytes)

b/code/nel/include/nel/misc/mutex.h Mon May 10 21:07:45 2010 +0200
237 237
#	endif // NL_DEBUG
238 238
#	endif // NL_NO_ASM
239 239
#else
240
		ASM_ASWAP_FOR_GCC_XCHG
240
    // GCC implements the same functionality using a builtin function
241
    // http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html
242
    // the macro below crashed on Mac OS X 10.6 in a 64bit build
243
    //ASM_ASWAP_FOR_GCC_XCHG
244
    result = __sync_bool_compare_and_swap(lockPtr, 0, 1);
241 245
#endif // NL_OS_WINDOWS
242 246
		return result != 0;
243 247
	}