3 #ifndef _CDS_URCU_OPTIONS_H
4 #define _CDS_URCU_OPTIONS_H
6 #include <cds/details/defs.h>
8 namespace cds { namespace urcu {
9 /// Exception "RCU deadlock detected"
10 /**@anchor cds_urcu_rcu_deadlock
11 This exception is raised when \p cds::opt::v::rcu_throw_deadlock deadlock checking policy
12 is used, see \p cds::opt::rcu_check_deadlock option.
14 class rcu_deadlock: public cds::Exception
17 typedef cds::Exception base_class;
20 : base_class( "RCU deadlock detected")
24 }} // namespace cds::urcu
27 namespace cds { namespace opt {
29 /// [type-option] RCU check deadlock option setter
31 The RCU containers can check if a deadlock between read-side critical section
32 and \p synchronize call is possible.
33 This option specifies a policy for checking this situation.
35 - \p opt::v::rcu_no_check_deadlock - no deadlock checking
36 - \p opt::v::rcu_assert_deadlock - call \p assert in debug mode only
37 - \p opt::v::rcu_throw_deadlock - throw an \p cds::urcu::rcu_deadlock exception when a deadlock
40 Usually, the default \p Type for this option is \p opt::v::rcu_throw_deadlock.
42 template <typename Type>
43 struct rcu_check_deadlock
46 template <typename Base> struct pack: public Base
48 typedef Type rcu_check_deadlock;
54 /// \ref opt::rcu_check_deadlock option value: no deadlock checking
55 struct rcu_no_check_deadlock {};
57 /// \ref opt::rcu_check_deadlock option value: call \p assert in debug mode only
58 struct rcu_assert_deadlock {};
60 /// \ref opt::rcu_check_deadlock option value: throw a cds::urcu::rcu_deadlock exception when a deadlock detected
61 struct rcu_throw_deadlock {};
63 }} // namespace cds::opt
66 #endif // #ifndef _CDS_URCU_OPTIONS_H