2 This file is a part of libcds - Concurrent Data Structures library
4 (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
6 Source code repo: http://github.com/khizmax/libcds/
7 Download: http://sourceforge.net/projects/libcds/files/
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
12 * Redistributions of source code must retain the above copyright notice, this
13 list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright notice,
16 this list of conditions and the following disclaimer in the documentation
17 and/or other materials provided with the distribution.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "list/hdr_intrusive_michael.h"
32 #include <cds/urcu/signal_threaded.h>
33 #include <cds/intrusive/michael_list_rcu.h>
36 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
38 typedef cds::urcu::gc< cds::urcu::signal_threaded<> > RCU;
42 void IntrusiveMichaelListHeaderTest::RCU_SHT_base_cmp()
44 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
45 typedef base_int_item< RCU > item;
46 struct traits : public ci::michael_list::traits
48 typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
49 typedef cmp<item> compare;
50 typedef faked_disposer disposer;
52 typedef ci::MichaelList< RCU, item, traits > list;
56 void IntrusiveMichaelListHeaderTest::RCU_SHT_base_less()
58 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
59 typedef base_int_item< RCU > item;
60 struct traits : public ci::michael_list::traits
62 typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
63 typedef IntrusiveMichaelListHeaderTest::less<item> less;
64 typedef faked_disposer disposer;
66 typedef ci::MichaelList< RCU, item, traits > list;
70 void IntrusiveMichaelListHeaderTest::RCU_SHT_base_cmpmix()
72 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
73 typedef base_int_item< RCU > item;
74 typedef ci::MichaelList< RCU
76 ,ci::michael_list::make_traits<
77 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
78 ,co::less< less<item> >
79 ,co::compare< cmp<item> >
80 ,ci::opt::disposer< faked_disposer >
86 void IntrusiveMichaelListHeaderTest::RCU_SHT_base_ic()
88 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
89 typedef base_int_item< RCU > item;
90 typedef ci::MichaelList< RCU
92 ,ci::michael_list::make_traits<
93 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
94 ,co::less< less<item> >
95 ,co::compare< cmp<item> >
96 ,ci::opt::disposer< faked_disposer >
97 ,co::item_counter< cds::atomicity::item_counter >
100 test_rcu_int<list>();
103 void IntrusiveMichaelListHeaderTest::RCU_SHT_member_cmp()
105 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
106 typedef member_int_item< RCU > item;
107 typedef ci::MichaelList< RCU
109 ,ci::michael_list::make_traits<
110 ci::opt::hook< ci::michael_list::member_hook<
111 offsetof( item, hMember ),
114 ,co::compare< cmp<item> >
115 ,ci::opt::disposer< faked_disposer >
118 test_rcu_int<list>();
121 void IntrusiveMichaelListHeaderTest::RCU_SHT_member_less()
123 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
124 typedef member_int_item< RCU > item;
125 typedef ci::MichaelList< RCU
127 ,ci::michael_list::make_traits<
128 ci::opt::hook< ci::michael_list::member_hook<
129 offsetof( item, hMember ),
132 ,co::less< less<item> >
133 ,ci::opt::disposer< faked_disposer >
136 test_rcu_int<list>();
139 void IntrusiveMichaelListHeaderTest::RCU_SHT_member_cmpmix()
141 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
142 typedef member_int_item< RCU > item;
143 typedef ci::MichaelList< RCU
145 ,ci::michael_list::make_traits<
146 ci::opt::hook< ci::michael_list::member_hook<
147 offsetof( item, hMember ),
150 ,co::less< less<item> >
151 ,co::compare< cmp<item> >
152 ,ci::opt::disposer< faked_disposer >
155 test_rcu_int<list>();
158 void IntrusiveMichaelListHeaderTest::RCU_SHT_member_ic()
160 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
161 typedef member_int_item< RCU > item;
162 typedef ci::MichaelList< RCU
164 ,ci::michael_list::make_traits<
165 ci::opt::hook< ci::michael_list::member_hook<
166 offsetof( item, hMember ),
169 ,co::compare< cmp<item> >
170 ,ci::opt::disposer< faked_disposer >
171 ,co::item_counter< cds::atomicity::item_counter >
174 test_rcu_int<list>();