/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSLIB_CONTAINER_DETAILS_BRONSON_AVLTREE_BASE_H
, m_pParent( nullptr )
, m_pLeft( nullptr )
, m_pRight( nullptr )
- , m_pValue( nullptr )
- {}
+ {
+ m_pValue.store( nullptr, atomics::memory_order_release );
+ }
link_node( int nHeight, version_type version, node_type * pParent, node_type * pLeft, node_type * pRight )
: m_nHeight( nHeight )
, m_pParent( pParent )
, m_pLeft( pLeft )
, m_pRight( pRight )
- , m_pValue( nullptr )
- {}
+ {
+ m_pValue.store( nullptr, atomics::memory_order_release );
+ }
node_type * parent( atomics::memory_order order ) const
{
void wait_until_shrink_completed( atomics::memory_order order ) const
{
BackOff bkoff;
- while ( is_shrinking( order ) )
+ while ( is_shrinking( order ))
bkoff();
}
template <typename Q>
node( Q&& key )
: base_class()
- , m_key( std::forward<Q>( key ) )
+ , m_key( std::forward<Q>( key ))
, m_pNextRemoved( nullptr )
{}
template <typename Q>
node( Q&& key, int nHeight, version_type version, node * pParent, node * pLeft, node * pRight )
: base_class( nHeight, version, pParent, pLeft, pRight )
- , m_key( std::forward<Q>( key ) )
+ , m_key( std::forward<Q>( key ))
, m_pNextRemoved( nullptr )
{}
//@endcond
/// Item counter
/**
The type for item counter, by default it is disabled (\p atomicity::empty_item_counter).
- To enable it use \p atomicity::item_counter
+ To enable it use \p atomicity::item_counter or \p atomicity::cache_friendly_item_counter.
*/
typedef atomicity::empty_item_counter item_counter;
/// Internal statistics
/**
- By default, internal statistics is disabled (\p ellen_bintree::empty_stat).
- To enable it use \p ellen_bintree::stat.
+ By default, internal statistics is disabled (\p bronson_avltree::empty_stat).
+ To enable it use \p bronson_avltree::stat.
*/
typedef empty_stat stat;
/// Back-off strategy
typedef cds::backoff::empty back_off;
- /// RCU deadlock checking policy (only for \ref cds_container_BronsonAVLTreeMap_rcu "RCU-based BronsonAVLTree")
+ /// RCU deadlock checking policy
/**
List of available options see \p opt::rcu_check_deadlock
*/
- \p bronson_avltree::relaxed_insert - enable (\p true) or disable (\p false, the default)
@ref bronson_avltree::relaxed_insert "relaxed insertion"
- \p opt::item_counter - the type of item counting feature, by default it is disabled (\p atomicity::empty_item_counter)
- To enable it use \p atomicity::item_counter
+ To enable it use \p atomicity::item_counter or \p atomicity::cache_friendly_item_counter
- \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
or \p opt::v::sequential_consistent (sequentially consisnent memory model).
- \p opt::stat - internal statistics, by default it is disabled (\p bronson_avltree::empty_stat)