shared(int) val = 5; atomic_fetch_and_impl(&val, 3); assert(atomic_load_impl(&val) == 1);
See Implementation