view paper/src/atomicImpl.cbc @ 19:046b2b20d6c7 default tip

fix
author ryokka
date Mon, 09 Mar 2020 11:25:49 +0900
parents c7acb9211784
children
line wrap: on
line source

__code checkAndSetAtomicReference(struct AtomicReference* atomic, union Data** ptr, union Data* oldData, union Data* newData, __code next(...), __code fail(...)) {
    if (__sync_bool_compare_and_swap(ptr, oldData, newData)) {
        goto next(...);
    }
    goto fail(...);
}