X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FSMP.h;h=49bc336f9985aed40972e3f07e6c20b3508b4f28;hb=dc01512f14cc4710d1f6a7448e642cd11e5e3efe;hp=5d74667f8631a8aa9641712f96c745dad11d52ab;hpb=aee6d6898bdb8294637df4aa0ef824b268c55a01;p=ghc-hetmet.git diff --git a/includes/SMP.h b/includes/SMP.h index 5d74667..49bc336 100644 --- a/includes/SMP.h +++ b/includes/SMP.h @@ -218,6 +218,17 @@ xchg(StgPtr p, StgWord w) return old; } +STATIC_INLINE StgWord +cas(StgVolatilePtr p, StgWord o, StgWord n) +{ + StgWord result; + result = *p; + if (result == o) { + *p = n; + } + return result; +} + #endif /* !THREADED_RTS */ #endif /* SMP_H */