/*
* BUSY-LOOP.
*/
- while (*index->urcu_active_readers != 0)
+ while (index->urcu_active_readers[parity] != 0)
barrier();
}
/*
*/
void *urcu_publish_content(void **ptr, void *new)
{
- int ret, prev_parity;
+ int prev_parity;
void *oldptr;
/*
*/
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();
void urcu_unregister_thread(void)
{
- pthread_t self = pthread_self();
rcu_write_lock();
urcu_remove_reader(pthread_self());
rcu_write_unlock();