+/*
+ * urcu.c
+ *
+ * Userspace RCU library
+ *
+ * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ *
+ * Distributed under GPLv2
+ */
+
#include <stdio.h>
#include <pthread.h>
#include <signal.h>
/*
* BUSY-LOOP.
*/
- while (*index->urcu_active_readers != 0)
+ while (index->urcu_active_readers[parity] != 0)
barrier();
}
/*
*/
oldptr = *ptr;
*ptr = new;
- wmb(); /* Write ptr before changing the qparity */
/* All threads should read qparity before ptr */
+ /* Write ptr before changing the qparity */
force_mb_all_threads();
prev_parity = switch_next_urcu_qparity();