From: Mathieu Desnoyers Date: Sat, 22 Jun 2013 18:05:10 +0000 (-0400) Subject: doc/examples: document call_rcu() X-Git-Tag: v0.8.0~24 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=238eb13d671cc39e181203923ccae3e5c5b84148;p=userspace-rcu.git doc/examples: document call_rcu() Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/examples/urcu-flavors/mb.c b/doc/examples/urcu-flavors/mb.c index 24daaef..757fe9e 100644 --- a/doc/examples/urcu-flavors/mb.c +++ b/doc/examples/urcu-flavors/mb.c @@ -108,6 +108,12 @@ int main(int argc, char **argv) */ cds_list_for_each_entry_safe(node, n, &mylist, node) { cds_list_del_rcu(&node->node); + /* + * call_rcu() will ensure that the handler + * "rcu_free_node" is executed after a grace period. + * call_rcu() can be called from RCU read-side critical + * sections. + */ call_rcu(&node->rcu_head, rcu_free_node); } diff --git a/doc/examples/urcu-flavors/qsbr.c b/doc/examples/urcu-flavors/qsbr.c index 75302f0..6f5b9b5 100644 --- a/doc/examples/urcu-flavors/qsbr.c +++ b/doc/examples/urcu-flavors/qsbr.c @@ -98,6 +98,12 @@ int main(int argc, char **argv) */ cds_list_for_each_entry_safe(node, n, &mylist, node) { cds_list_del_rcu(&node->node); + /* + * call_rcu() will ensure that the handler + * "rcu_free_node" is executed after a grace period. + * call_rcu() can be called from RCU read-side critical + * sections. + */ call_rcu(&node->rcu_head, rcu_free_node); } diff --git a/doc/examples/urcu-flavors/signal.c b/doc/examples/urcu-flavors/signal.c index 53bb57f..b7c279c 100644 --- a/doc/examples/urcu-flavors/signal.c +++ b/doc/examples/urcu-flavors/signal.c @@ -107,6 +107,12 @@ int main(int argc, char **argv) */ cds_list_for_each_entry_safe(node, n, &mylist, node) { cds_list_del_rcu(&node->node); + /* + * call_rcu() will ensure that the handler + * "rcu_free_node" is executed after a grace period. + * call_rcu() can be called from RCU read-side critical + * sections. + */ call_rcu(&node->rcu_head, rcu_free_node); }