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_threaded.h>
33 #include <cds/intrusive/michael_list_rcu.h>
37 typedef cds::urcu::gc< cds::urcu::general_threaded<> > RCU;
40 void IntrusiveMichaelListHeaderTest::RCU_GPT_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_GPT_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_GPT_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_GPT_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_GPT_member_cmp()
95 typedef member_int_item< RCU > item;
96 typedef ci::MichaelList< RCU
98 ,ci::michael_list::make_traits<
99 ci::opt::hook< ci::michael_list::member_hook<
100 offsetof( item, hMember ),
103 ,co::compare< cmp<item> >
104 ,ci::opt::disposer< faked_disposer >
107 test_rcu_int<list>();
109 void IntrusiveMichaelListHeaderTest::RCU_GPT_member_less()
111 typedef member_int_item< RCU > item;
112 typedef ci::MichaelList< RCU
114 ,ci::michael_list::make_traits<
115 ci::opt::hook< ci::michael_list::member_hook<
116 offsetof( item, hMember ),
119 ,co::less< less<item> >
120 ,ci::opt::disposer< faked_disposer >
123 test_rcu_int<list>();
125 void IntrusiveMichaelListHeaderTest::RCU_GPT_member_cmpmix()
127 typedef member_int_item< RCU > item;
128 typedef ci::MichaelList< RCU
130 ,ci::michael_list::make_traits<
131 ci::opt::hook< ci::michael_list::member_hook<
132 offsetof( item, hMember ),
135 ,co::less< less<item> >
136 ,co::compare< cmp<item> >
137 ,ci::opt::disposer< faked_disposer >
140 test_rcu_int<list>();
142 void IntrusiveMichaelListHeaderTest::RCU_GPT_member_ic()
144 typedef member_int_item< RCU > item;
145 typedef ci::MichaelList< RCU
147 ,ci::michael_list::make_traits<
148 ci::opt::hook< ci::michael_list::member_hook<
149 offsetof( item, hMember ),
152 ,co::compare< cmp<item> >
153 ,ci::opt::disposer< faked_disposer >
154 ,co::item_counter< cds::atomicity::item_counter >
157 test_rcu_int<list>();