X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=doc%2Fexamples%2Frcu-flavor-qsbr%2Frcu-flavor-qsbr.c;h=2b722c0a1e0dcf1fda29236534b6f99758be6379;hp=a7a6ff45e01269b5f22b6ec0916064a653390511;hb=71ea53b1c44c78bac18de7ac205bf1bdc4125353;hpb=dfee93b119a3a18937ee12121be5977bd41379d3 diff --git a/doc/examples/rcu-flavor-qsbr/rcu-flavor-qsbr.c b/doc/examples/rcu-flavor-qsbr/rcu-flavor-qsbr.c index a7a6ff4..2b722c0 100644 --- a/doc/examples/rcu-flavor-qsbr/rcu-flavor-qsbr.c +++ b/doc/examples/rcu-flavor-qsbr/rcu-flavor-qsbr.c @@ -16,16 +16,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define _LGPL_SOURCE -#include -#include -#include - #include #include #include #include +#include /* QSBR RCU flavor */ +#include /* List example */ +#include /* For CAA_ARRAY_SIZE */ + /* * This is a mock-up example where updates and RCU traversals are * performed by the same thread to keep things simple on purpose. @@ -110,7 +109,9 @@ int main(int argc, char **argv) /* * For QSBR flavor, we need to explicitly announce quiescent - * states. + * states. Here is how it is done. This should be performed by + * every online registered RCU threads in the program + * periodically. */ rcu_quiescent_state(); @@ -127,7 +128,8 @@ int main(int argc, char **argv) /* * Waiting for previously called call_rcu handlers to complete - * before program exits is a good practice. + * before program exits, or in library destructors, is a good + * practice. */ rcu_barrier();