Beispiel #1
0
Datei: mt.c Projekt: yoanlcq/FATE
static void fe_mt_tsx_unlock_x86hle(fe_mt_tsx *tsx) {
#ifdef _MSVC_VER
    _InterlockedExchange_HLERelease(&(tsx->as_hle), 0);
#else
    __atomic_store_4(&(tsx->as_hle), 0, __ATOMIC_RELEASE 
                                      | __ATOMIC_HLE_RELEASE);
#endif
}
P_LIB_API void
p_atomic_pointer_set (volatile void	*atomic,
		      ppointer		val)
{
#if (PLIBSYS_SIZEOF_VOID_P == 8)
	__atomic_store_8 (atomic, (psize) val, __ATOMIC_SEQ_CST);
#else
	__atomic_store_4 (atomic, (psize) val, __ATOMIC_SEQ_CST);
#endif
}
P_LIB_API void
p_atomic_int_set (volatile pint	*atomic,
		  pint		val)
{
	__atomic_store_4 (atomic, val, __ATOMIC_SEQ_CST);
}