To keep this thread up-to-date: https://phabricator.haskell.org/D2431
2016-07-27 14:08 GMT+00:00 Alex Biehl :
> There already is the CallishMachOp MO_cmpxchg in
> https://github.com/ghc/ghc/blob/5d98b8bf249fab9bb0be6c5d4e8ddd4578994abb/compiler/cmm/CmmMachOp.hs#L587
>
> All
This is from definition of stg_atomicModifyMutVarzh(): (for threaded runtime)
retry:
x = StgMutVar_var(mv);
StgThunk_payload(z,1) = x;
(h) = ccall cas(mv + SIZEOF_StgHeader + OFFSET_StgMutVar_var, x, y);
if (h != x) { goto retry; }
cas() is defined in