bugfix in cds::gc::HP::guarded_ptr
[libcds.git] / tests / test-hdr / ordered_list / hdr_intrusive_michael_list_rcu_shb.cpp
1 //$$CDS-header$$
2
3 #include "ordered_list/hdr_intrusive_michael.h"
4 #include <cds/urcu/signal_buffered.h>
5 #include <cds/intrusive/michael_list_rcu.h>
6
7 namespace ordlist {
8 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
9     namespace {
10         typedef cds::urcu::gc< cds::urcu::signal_buffered<> >    RCU;
11     }
12 #endif
13
14     void IntrusiveMichaelListHeaderTest::RCU_SHB_base_cmp()
15     {
16 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
17         typedef base_int_item< RCU > item;
18         struct traits : public ci::michael_list::traits
19         {
20             typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
21             typedef cmp<item> compare;
22             typedef faked_disposer disposer;
23         };
24         typedef ci::MichaelList< RCU, item, traits > list;
25         test_rcu_int<list>();
26 #endif
27     }
28     void IntrusiveMichaelListHeaderTest::RCU_SHB_base_less()
29     {
30 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
31         typedef base_int_item< RCU > item;
32         struct traits : public ci::michael_list::traits
33         {
34             typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
35             typedef IntrusiveMichaelListHeaderTest::less<item> less;
36             typedef faked_disposer disposer;
37         };
38         typedef ci::MichaelList< RCU, item, traits > list;
39         test_rcu_int<list>();
40 #endif
41     }
42     void IntrusiveMichaelListHeaderTest::RCU_SHB_base_cmpmix()
43     {
44 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
45         typedef base_int_item< RCU > item;
46         typedef ci::MichaelList< RCU
47             ,item
48             ,ci::michael_list::make_traits<
49                 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
50                 ,co::less< less<item> >
51                 ,co::compare< cmp<item> >
52                 ,ci::opt::disposer< faked_disposer >
53             >::type
54         >    list;
55         test_rcu_int<list>();
56 #endif
57     }
58     void IntrusiveMichaelListHeaderTest::RCU_SHB_base_ic()
59     {
60 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
61         typedef base_int_item< RCU > item;
62         typedef ci::MichaelList< RCU
63             ,item
64             ,ci::michael_list::make_traits<
65                 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
66                 ,co::less< less<item> >
67                 ,co::compare< cmp<item> >
68                 ,ci::opt::disposer< faked_disposer >
69                 ,co::item_counter< cds::atomicity::item_counter >
70             >::type
71         >    list;
72         test_rcu_int<list>();
73 #endif
74     }
75     void IntrusiveMichaelListHeaderTest::RCU_SHB_member_cmp()
76     {
77 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
78         typedef member_int_item< RCU > item;
79         typedef ci::MichaelList< RCU
80             ,item
81             ,ci::michael_list::make_traits<
82                 ci::opt::hook< ci::michael_list::member_hook<
83                     offsetof( item, hMember ),
84                     co::gc<RCU>
85                 > >
86                 ,co::compare< cmp<item> >
87                 ,ci::opt::disposer< faked_disposer >
88             >::type
89         >    list;
90         test_rcu_int<list>();
91 #endif
92     }
93     void IntrusiveMichaelListHeaderTest::RCU_SHB_member_less()
94     {
95 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
96         typedef member_int_item< RCU > item;
97         typedef ci::MichaelList< RCU
98             ,item
99             ,ci::michael_list::make_traits<
100                 ci::opt::hook< ci::michael_list::member_hook<
101                     offsetof( item, hMember ),
102                     co::gc<RCU>
103                 > >
104                 ,co::less< less<item> >
105                 ,ci::opt::disposer< faked_disposer >
106             >::type
107         >    list;
108         test_rcu_int<list>();
109 #endif
110     }
111     void IntrusiveMichaelListHeaderTest::RCU_SHB_member_cmpmix()
112     {
113 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
114         typedef member_int_item< RCU > item;
115         typedef ci::MichaelList< RCU
116             ,item
117             ,ci::michael_list::make_traits<
118                 ci::opt::hook< ci::michael_list::member_hook<
119                     offsetof( item, hMember ),
120                     co::gc<RCU>
121                 > >
122                 ,co::less< less<item> >
123                 ,co::compare< cmp<item> >
124                 ,ci::opt::disposer< faked_disposer >
125             >::type
126         >    list;
127         test_rcu_int<list>();
128 #endif
129     }
130     void IntrusiveMichaelListHeaderTest::RCU_SHB_member_ic()
131     {
132 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
133         typedef member_int_item< RCU > item;
134         typedef ci::MichaelList< RCU
135             ,item
136             ,ci::michael_list::make_traits<
137                 ci::opt::hook< ci::michael_list::member_hook<
138                     offsetof( item, hMember ),
139                     co::gc<RCU>
140                 > >
141                 ,co::compare< cmp<item> >
142                 ,ci::opt::disposer< faked_disposer >
143                 ,co::item_counter< cds::atomicity::item_counter >
144             >::type
145         >    list;
146         test_rcu_int<list>();
147 #endif
148     }
149
150 }