Commit 10d2951e authored by Paul McKenney's avatar Paul McKenney Committed by Facebook Github Bot

Add documentation header for Folly::rcu_reader and Foly::rcu_reader_domain (#1307)

Summary:
Pull Request resolved: https://github.com/facebook/folly/pull/1307

The current documentation for Folly::rcu_reader and Foly::rcu_reader_domain is lacking, so this commit adds comment headers.

Reviewed By: ot, magedm

Differential Revision: D18620267

fbshipit-source-id: 98d26aa2f54fccf85de1fc5fda99a1843739bee0
parent 99c5b866
...@@ -409,7 +409,10 @@ inline rcu_domain<RcuTag>* rcu_default_domain() { ...@@ -409,7 +409,10 @@ inline rcu_domain<RcuTag>* rcu_default_domain() {
return *rcu_default_domain_; return *rcu_default_domain_;
} }
// Main reader guard class. // Main reader guard class. Use rcu_reader instead unless you need to
// specify a custom domain. Note that the default domain will work
// in almost all use cases. Please see rcu_domain for more information on
// custom domains.
template <typename Tag = RcuTag> template <typename Tag = RcuTag>
class rcu_reader_domain { class rcu_reader_domain {
public: public:
...@@ -460,6 +463,11 @@ class rcu_reader_domain { ...@@ -460,6 +463,11 @@ class rcu_reader_domain {
rcu_domain<Tag>* domain_; rcu_domain<Tag>* domain_;
}; };
// Mark an RCU read-side critical section using RAII style, as in
// folly::rcu_reader rcuGuard.
//
// This uses the default RCU domain, which suffices for most use cases.
// Please see the rcu_domain documentation for more information.
using rcu_reader = rcu_reader_domain<RcuTag>; using rcu_reader = rcu_reader_domain<RcuTag>;
template <typename Tag = RcuTag> template <typename Tag = RcuTag>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment