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