1 #define FACTOR_FORCE_INLINE __forceinline
5 __forceinline static bool cas(volatile cell* ptr, cell old_val, cell new_val) {
6 return InterlockedCompareExchange(reinterpret_cast<volatile LONG*>(ptr),
7 (LONG) old_val, (LONG) new_val) ==
10 __forceinline static bool cas(volatile fixnum* ptr, fixnum old_val,
12 return InterlockedCompareExchange(reinterpret_cast<volatile LONG*>(ptr),
13 (LONG) old_val, (LONG) new_val) ==
17 __forceinline static cell fetch_add(volatile cell* ptr, cell val) {
18 return (cell)InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
21 __forceinline static fixnum fetch_add(volatile fixnum* ptr, fixnum val) {
22 return (fixnum)InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
26 __forceinline static cell fetch_subtract(volatile cell* ptr, cell val) {
27 return (cell)InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
30 __forceinline static fixnum fetch_subtract(volatile fixnum* ptr, fixnum val) {
31 return (fixnum)InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
35 __forceinline static void fence() { MemoryBarrier(); }