(void) __atomic_add_fetch(&cpu_gp_state->count[period].begin, 1, __ATOMIC_RELAXED);
fence:
/*
- * This memory barrier (A) ensures that the contents of the
- * read-side critical section does not leak before the "begin"
- * counter increment. It pairs with memory barriers (D) and (E).
+ * This compiler barrier (A) is paired with membarrier() at (C),
+ * (D), (E). It effectively upgrades this compiler barrier to a
+ * SEQ_CST fence with respect to the paired barriers.
*
- * This memory barrier (A) also ensures that the "begin"
- * increment is before the "end" increment. It pairs with memory
- * barrier (C). It is redundant with memory barrier (B) for that
- * purpose.
+ * This barrier (A) ensures that the contents of the read-side
+ * critical section does not leak before the "begin" counter
+ * increment. It pairs with memory barriers (D) and (E).
+ *
+ * This barrier (A) also ensures that the "begin" increment is
+ * before the "end" increment. It pairs with memory barrier (C).
+ * It is redundant with barrier (B) for that purpose.
*/
rseq_barrier();
return period;
int cpu;
/*
- * This memory barrier (B) ensures that the contents of the
- * read-side critical section does not leak after the "end"
- * counter increment. It pairs with memory barriers (D) and (E).
+ * This compiler barrier (B) is paired with membarrier() at (C),
+ * (D), (E). It effectively upgrades this compiler barrier to a
+ * SEQ_CST fence with respect to the paired barriers.
+ *
+ * This barrier (B) ensures that the contents of the read-side
+ * critical section does not leak after the "end" counter
+ * increment. It pairs with memory barriers (D) and (E).
*
- * This memory barrier (B) also ensures that the "begin"
- * increment is before the "end" increment. It pairs with memory
- * barrier (C). It is redundant with memory barrier (A) for that
- * purpose.
+ * This barrier (B) also ensures that the "begin" increment is
+ * before the "end" increment. It pairs with memory barrier (C).
+ * It is redundant with barrier (A) for that purpose.
*/
rseq_barrier();