MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / atomic_cas_ptr

Function atomic_cas_ptr

vm/ByteCodeTranslator/src/rpmalloc.c:1582–1595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1580}
1581
1582static FORCEINLINE int
1583atomic_cas_ptr(atomicptr_t* dst, void* val, void* ref) {
1584#ifdef _MSC_VER
1585# if ARCH_64BIT
1586 return (_InterlockedCompareExchange64((volatile long long*)&dst->nonatomic,
1587 (long long)val, (long long)ref) == (long long)ref) ? 1 : 0;
1588# else
1589 return (_InterlockedCompareExchange((volatile long*)&dst->nonatomic,
1590 (long)val, (long)ref) == (long)ref) ? 1 : 0;
1591# endif
1592#else
1593 return __sync_bool_compare_and_swap(&dst->nonatomic, ref, val);
1594#endif
1595}
1596
1597//! Yield the thread remaining timeslice
1598static void

Calls

no outgoing calls

Tested by

no test coverage detected