* granted, provided the above notices are retained, and a notice that
* the code was modified is included with the above copyright notice.
*
- * This example shows how to to a RCU linked list traversal, safely
+ * This example shows how to do a RCU linked list traversal, safely
* against concurrent RCU updates.
*/
#include <stdio.h>
-#include <urcu.h> /* Userspace RCU flavor */
+#include <urcu/urcu-memb.h> /* Userspace RCU flavor */
#include <urcu/rculist.h> /* RCU list */
#include <urcu/compiler.h> /* For CAA_ARRAY_SIZE */
struct mynode *node;
/*
- * Each thread need using RCU read-side need to be explicitely
+ * Each thread need using RCU read-side need to be explicitly
* registered.
*/
- rcu_register_thread();
+ urcu_memb_register_thread();
/*
* Adding nodes to the linked-list. Safe against concurrent
printf("mylist content:");
/*
- * Surround the RCU read-side critical section with rcu_read_lock()
- * and rcu_read_unlock().
+ * Surround the RCU read-side critical section with urcu_memb_read_lock()
+ * and urcu_memb_read_unlock().
*/
- rcu_read_lock();
+ urcu_memb_read_lock();
/*
* This traversal can be performed concurrently with RCU
printf(" %d", node->value);
}
- rcu_read_unlock();
+ urcu_memb_read_unlock();
printf("\n");
end:
- rcu_unregister_thread();
+ urcu_memb_unregister_thread();
return ret;
}