X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Finclude%2Fgeneric%2Frte_mcslock.h;h=d370bef17a4d64db296bda5a625bf4a7ef6309ba;hb=021b698eb56e48009d74d818bea5a9bdad4f54fa;hp=78b0df295e2d9a4341921695a1a83734f6be0224;hpb=f32fed83db8ba3f929d520bd370df612728a130b;p=dpdk.git diff --git a/lib/librte_eal/include/generic/rte_mcslock.h b/lib/librte_eal/include/generic/rte_mcslock.h index 78b0df295e..d370bef17a 100644 --- a/lib/librte_eal/include/generic/rte_mcslock.h +++ b/lib/librte_eal/include/generic/rte_mcslock.h @@ -64,7 +64,14 @@ rte_mcslock_lock(rte_mcslock_t **msl, rte_mcslock_t *me) */ return; } - __atomic_store_n(&prev->next, me, __ATOMIC_RELAXED); + /* The store to me->next above should also complete before the node is + * visible to predecessor thread releasing the lock. Hence, the store + * prev->next also requires release semantics. Note that, for example, + * on ARM, the release semantics in the exchange operation is not + * strong as a release fence and is not sufficient to enforce the + * desired order here. + */ + __atomic_store_n(&prev->next, me, __ATOMIC_RELEASE); /* The while-load of me->locked should not move above the previous * store to prev->next. Otherwise it will cause a deadlock. Need a