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_michael.h"
32 #include <cds/urcu/signal_buffered.h>
33 #include <cds/container/michael_list_rcu.h>
36 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
38 typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
40 struct RCU_SHB_cmp_traits : public cc::michael_list::traits
42 typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
47 void MichaelListTestHeader::RCU_SHB_cmp()
49 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
50 // traits-based version
51 typedef cc::MichaelList< rcu_type, item, RCU_SHB_cmp_traits > list;
54 // option-based version
56 typedef cc::MichaelList< rcu_type, item,
57 cc::michael_list::make_traits<
58 cc::opt::compare< cmp<item> >
61 test_rcu< opt_list >();
65 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
67 struct RCU_SHB_less_traits : public cc::michael_list::traits
69 typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
73 void MichaelListTestHeader::RCU_SHB_less()
75 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
76 // traits-based version
77 typedef cc::MichaelList< rcu_type, item, RCU_SHB_less_traits > list;
80 // option-based version
82 typedef cc::MichaelList< rcu_type, item,
83 cc::michael_list::make_traits<
84 cc::opt::less< lt<item> >
87 test_rcu< opt_list >();
91 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
93 struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits
95 typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
96 typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
100 void MichaelListTestHeader::RCU_SHB_cmpmix()
102 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
103 // traits-based version
104 typedef cc::MichaelList< rcu_type, item, RCU_SHB_cmpmix_traits > list;
107 // option-based version
109 typedef cc::MichaelList< rcu_type, item,
110 cc::michael_list::make_traits<
111 cc::opt::compare< cmp<item> >
112 ,cc::opt::less< lt<item> >
115 test_rcu< opt_list >();
119 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
121 struct RCU_SHB_ic_traits: public cc::michael_list::traits
123 typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
124 typedef cds::atomicity::item_counter item_counter;
128 void MichaelListTestHeader::RCU_SHB_ic()
130 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
131 // traits-based version
132 typedef cc::MichaelList< rcu_type, item, RCU_SHB_ic_traits > list;
135 // option-based version
137 typedef cc::MichaelList< rcu_type, item,
138 cc::michael_list::make_traits<
139 cc::opt::less< lt<item> >
140 ,cc::opt::item_counter< cds::atomicity::item_counter >
143 test_rcu< opt_list >();
147 } // namespace ordlist