3 #include "set/hdr_set.h"
4 #include <cds/urcu/signal_buffered.h>
5 #include <cds/container/michael_list_rcu.h>
6 #include <cds/container/split_list_set_rcu.h>
10 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
12 typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
14 struct RCU_SHB_cmp_traits: public cc::split_list::type_traits
16 typedef cc::michael_list_tag ordered_list;
17 typedef HashSetHdrTest::hash_int hash;
18 typedef HashSetHdrTest::simple_item_counter item_counter;
19 typedef cc::opt::v::relaxed_ordering memory_model;
20 enum { dynamic_bucket_table = false };
22 struct ordered_list_traits: public cc::michael_list::type_traits
24 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
28 struct RCU_SHB_less_traits: public cc::split_list::type_traits
30 typedef cc::michael_list_tag ordered_list;
31 typedef HashSetHdrTest::hash_int hash;
32 typedef HashSetHdrTest::simple_item_counter item_counter;
33 typedef cc::opt::v::sequential_consistent memory_model;
34 enum { dynamic_bucket_table = false };
36 struct ordered_list_traits: public cc::michael_list::type_traits
38 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
42 struct RCU_SHB_cmpmix_traits: public cc::split_list::type_traits
44 typedef cc::michael_list_tag ordered_list;
45 typedef HashSetHdrTest::hash_int hash;
46 typedef HashSetHdrTest::simple_item_counter item_counter;
48 struct ordered_list_traits: public cc::michael_list::type_traits
50 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
51 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
57 void HashSetHdrTest::Split_RCU_SHB_cmp()
59 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
60 // traits-based version
61 typedef cc::SplitListSet< rcu_type, item, RCU_SHB_cmp_traits > set;
63 test_int_rcu< set >();
65 // option-based version
66 typedef cc::SplitListSet< rcu_type, item,
67 cc::split_list::make_traits<
68 cc::split_list::ordered_list<cc::michael_list_tag>
69 ,cc::opt::hash< hash_int >
70 ,cc::opt::item_counter< simple_item_counter >
71 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
72 ,cc::split_list::dynamic_bucket_table< true >
73 ,cc::split_list::ordered_list_traits<
74 cc::michael_list::make_traits<
75 cc::opt::compare< cmp<item> >
80 test_int_rcu< opt_set >();
84 void HashSetHdrTest::Split_RCU_SHB_less()
86 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
87 // traits-based version
88 typedef cc::SplitListSet< rcu_type, item, RCU_SHB_less_traits > set;
90 test_int_rcu< set >();
92 // option-based version
93 typedef cc::SplitListSet< rcu_type, item,
94 cc::split_list::make_traits<
95 cc::split_list::ordered_list<cc::michael_list_tag>
96 ,cc::opt::hash< hash_int >
97 ,cc::opt::item_counter< simple_item_counter >
98 ,cc::opt::memory_model< cc::opt::v::sequential_consistent >
99 ,cc::split_list::dynamic_bucket_table< false >
100 ,cc::split_list::ordered_list_traits<
101 cc::michael_list::make_traits<
102 cc::opt::less< less<item> >
107 test_int_rcu< opt_set >();
111 void HashSetHdrTest::Split_RCU_SHB_cmpmix()
113 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
114 // traits-based version
115 typedef cc::SplitListSet< rcu_type, item, RCU_SHB_cmpmix_traits > set;
116 test_int_rcu< set >();
118 // option-based version
119 typedef cc::SplitListSet< rcu_type, item,
120 cc::split_list::make_traits<
121 cc::split_list::ordered_list<cc::michael_list_tag>
122 ,cc::opt::hash< hash_int >
123 ,cc::opt::item_counter< simple_item_counter >
124 ,cc::split_list::ordered_list_traits<
125 cc::michael_list::make_traits<
126 cc::opt::less< less<item> >
127 ,cc::opt::compare< cmp<item> >
132 test_int_rcu< opt_set >();