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/general_instant.h>
33 #include <cds/intrusive/michael_list_rcu.h>
37 typedef cds::urcu::gc< cds::urcu::general_instant<> > RCU;
40 void IntrusiveMichaelListHeaderTest::RCU_GPI_base_cmp()
42 typedef base_int_item< RCU > item;
43 struct traits : public ci::michael_list::traits
45 typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
46 typedef cmp<item> compare;
47 typedef faked_disposer disposer;
49 typedef ci::MichaelList< RCU, item, traits > list;
52 void IntrusiveMichaelListHeaderTest::RCU_GPI_base_less()
54 typedef base_int_item< RCU > item;
55 struct traits : public ci::michael_list::traits
57 typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
58 typedef IntrusiveMichaelListHeaderTest::less<item> less;
59 typedef faked_disposer disposer;
61 typedef ci::MichaelList< RCU, item, traits > list;
64 void IntrusiveMichaelListHeaderTest::RCU_GPI_base_cmpmix()
66 typedef base_int_item< RCU > item;
67 typedef ci::MichaelList< RCU
69 ,ci::michael_list::make_traits<
70 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
71 ,co::less< less<item> >
72 ,co::compare< cmp<item> >
73 ,ci::opt::disposer< faked_disposer >
78 void IntrusiveMichaelListHeaderTest::RCU_GPI_base_ic()
80 typedef base_int_item< RCU > item;
81 typedef ci::MichaelList< RCU
83 ,ci::michael_list::make_traits<
84 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
85 ,co::less< less<item> >
86 ,co::compare< cmp<item> >
87 ,ci::opt::disposer< faked_disposer >
88 ,co::item_counter< cds::atomicity::item_counter >
93 void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmp()
95 typedef member_int_item< RCU > item;
97 ci::michael_list::make_traits<
98 ci::opt::hook< ci::michael_list::member_hook<
99 offsetof( item, hMember ),
102 ,co::compare< cmp<item> >
103 ,ci::opt::disposer< faked_disposer >
106 typedef ci::MichaelList< RCU, item, traits > list;
107 test_rcu_int<list>();
109 void IntrusiveMichaelListHeaderTest::RCU_GPI_member_less()
111 typedef member_int_item< RCU > item;
112 struct traits: public
113 ci::michael_list::make_traits<
114 ci::opt::hook< ci::michael_list::member_hook<
115 offsetof( item, hMember ),
118 ,co::less< less<item> >
119 ,ci::opt::disposer< faked_disposer >
122 typedef ci::MichaelList< RCU, item, traits > list;
123 test_rcu_int<list>();
125 void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmpmix()
127 typedef member_int_item< RCU > item;
128 struct traits: public
129 ci::michael_list::make_traits<
130 ci::opt::hook< ci::michael_list::member_hook<
131 offsetof( item, hMember ),
134 ,co::less< less<item> >
135 ,co::compare< cmp<item> >
136 ,ci::opt::disposer< faked_disposer >
139 typedef ci::MichaelList< RCU, item, traits > list;
140 test_rcu_int<list>();
142 void IntrusiveMichaelListHeaderTest::RCU_GPI_member_ic()
144 typedef member_int_item< RCU > item;
145 struct traits: public
146 ci::michael_list::make_traits<
147 ci::opt::hook< ci::michael_list::member_hook<
148 offsetof( item, hMember ),
151 ,co::compare< cmp<item> >
152 ,ci::opt::disposer< faked_disposer >
153 ,co::item_counter< cds::atomicity::item_counter >
156 typedef ci::MichaelList< RCU, item, traits > list;
157 test_rcu_int<list>();
159 } // namespace ordlist