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_lazy_kv.h"
32 #include <cds/urcu/signal_buffered.h>
33 #include <cds/container/lazy_kvlist_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::lazy_list::traits
42 typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
47 void LazyKVListTestHeader::RCU_SHB_cmp()
49 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
50 // traits-based version
51 typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > list;
54 // option-based version
56 typedef cc::LazyKVList< rcu_type, key_type, value_type,
57 cc::lazy_list::make_traits<
58 cc::opt::compare< cmp<key_type> >
61 test_rcu< opt_list >();
65 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
67 struct RCU_SHB_less_traits: public cc::lazy_list::traits
69 typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
74 void LazyKVListTestHeader::RCU_SHB_less()
76 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
77 // traits-based version
78 typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_less_traits > list;
81 // option-based version
83 typedef cc::LazyKVList< rcu_type, key_type, value_type,
84 cc::lazy_list::make_traits<
85 cc::opt::less< lt<key_type> >
88 test_rcu< opt_list >();
92 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
94 struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits
96 typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
97 typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
102 void LazyKVListTestHeader::RCU_SHB_cmpmix()
104 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
105 // traits-based version
106 typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_cmpmix_traits > list;
109 // option-based version
111 typedef cc::LazyKVList< rcu_type, key_type, value_type,
112 cc::lazy_list::make_traits<
113 cc::opt::compare< cmp<key_type> >
114 ,cc::opt::less< lt<key_type> >
117 test_rcu< opt_list >();
121 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
123 struct RCU_SHB_ic_traits: public cc::lazy_list::traits
125 typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
126 typedef cds::atomicity::item_counter item_counter;
131 void LazyKVListTestHeader::RCU_SHB_ic()
133 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
134 // traits-based version
135 typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_ic_traits > list;
138 // option-based version
140 typedef cc::LazyKVList< rcu_type, key_type, value_type,
141 cc::lazy_list::make_traits<
142 cc::opt::less< lt<key_type> >
143 ,cc::opt::item_counter< cds::atomicity::item_counter >
146 test_rcu< opt_list >();
150 } // namespace ordlist