config REFACTOR built-in atomics implement memoery barrier
diff --git a/src/path.c b/src/path.c
index 83b1ba3..f2b713c 100644
--- a/src/path.c
+++ b/src/path.c
@@ -552,7 +552,7 @@
++(*tok_idx);
/* "allocate" the type to avoid problems when freeing the value after the type was freed */
- LY_ATOMIC_INC_RELAXED(((struct lysc_type *)p->value.realtype)->refcount);
+ LY_ATOMIC_INC_BARRIER(((struct lysc_type *)p->value.realtype)->refcount);
/* ']' */
assert(expr->tokens[*tok_idx] == LYXP_TOKEN_BRACK2);
@@ -613,7 +613,7 @@
++(*tok_idx);
/* "allocate" the type to avoid problems when freeing the value after the type was freed */
- LY_ATOMIC_INC_RELAXED(((struct lysc_type *)p->value.realtype)->refcount);
+ LY_ATOMIC_INC_BARRIER(((struct lysc_type *)p->value.realtype)->refcount);
/* ']' */
assert(expr->tokens[*tok_idx] == LYXP_TOKEN_BRACK2);
@@ -1105,7 +1105,7 @@
/* key-predicate or leaf-list-predicate */
(*dup)[u].predicates[v].key = pred->key;
pred->value.realtype->plugin->duplicate(ctx, &pred->value, &(*dup)[u].predicates[v].value);
- LY_ATOMIC_INC_RELAXED(((struct lysc_type *)pred->value.realtype)->refcount);
+ LY_ATOMIC_INC_BARRIER(((struct lysc_type *)pred->value.realtype)->refcount);
break;
case LY_PATH_PREDTYPE_NONE:
break;