Commit 5f7079b9 authored by Simon Marlow's avatar Simon Marlow
Browse files

add a single-threaded version of cas()

parent aee6d689
......@@ -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 */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment