new = malloc(sizeof(*new));
new->a = 8;
old = rcu_xchg_pointer(&test_rcu_pointer, new);
- call_rcu(free, old);
- call_rcu(test_cb1, old);
- call_rcu(test_cb1, (void *)-2L);
- call_rcu(test_cb1, (void *)-2L);
- call_rcu(test_cb1, old);
- call_rcu(test_cb2, (void *)-2L);
- call_rcu(test_cb2, (void *)-4L);
- call_rcu(test_cb2, (void *)-2L);
+ defer_rcu(free, old);
+ defer_rcu(test_cb1, old);
+ defer_rcu(test_cb1, (void *)-2L);
+ defer_rcu(test_cb1, (void *)-2L);
+ defer_rcu(test_cb1, old);
+ defer_rcu(test_cb2, (void *)-2L);
+ defer_rcu(test_cb2, (void *)-4L);
+ defer_rcu(test_cb2, (void *)-2L);
nr_writes++;
if (unlikely(!test_duration_write()))
break;
}
/*
- * _rcu_defer_queue - Queue a RCU callback.
+ * _defer_rcu - Queue a RCU callback.
*/
-void _rcu_defer_queue(void (*fct)(void *p), void *p)
+void _defer_rcu(void (*fct)(void *p), void *p)
{
unsigned long head, tail;
* library wrappers to be used by non-LGPL compatible source code.
*/
-void rcu_defer_queue(void (*fct)(void *p), void *p)
+void defer_rcu(void (*fct)(void *p), void *p)
{
- _rcu_defer_queue(fct, p);
+ _defer_rcu(fct, p);
}
static void start_defer_thread(void)
* rcu_defer_register_thread(). rcu_defer_unregister_thread() should be
* called before the thread exits.
*
- * *NEVER* use call_rcu()/rcu_defer_queue() within a RCU read-side critical
- * section, because this primitive need to call synchronize_rcu() if the thread
- * queue is full.
+ * *NEVER* use defer_rcu() within a RCU read-side critical section, because this
+ * primitive need to call synchronize_rcu() if the thread queue is full.
*/
-#define call_rcu rcu_defer_queue
-#define rcu_reclaim_queue(p) rcu_defer_queue(free, p)
+#define rcu_reclaim_queue(p) defer_rcu(free, p)
-extern void rcu_defer_queue(void (*fct)(void *p), void *p);
+extern void defer_rcu(void (*fct)(void *p), void *p);
/*
* Thread registration for reclamation.