From 25f6df95be1521466e78b4db7a1bf34da590f41f Mon Sep 17 00:00:00 2001 From: khizmax Date: Wed, 26 Nov 2014 10:04:08 +0300 Subject: [PATCH 1/1] Revised noexcept expressions in back-off strategies --- cds/algo/backoff_strategy.h | 12 ++++++------ cds/intrusive/treiber_stack.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cds/algo/backoff_strategy.h b/cds/algo/backoff_strategy.h index 6cb479ef..c80ea829 100644 --- a/cds/algo/backoff_strategy.h +++ b/cds/algo/backoff_strategy.h @@ -59,7 +59,7 @@ namespace cds { {} template - bool operator()(Predicate pr) CDS_NOEXCEPT_( noexcept(Predicate()()) ) + bool operator()(Predicate pr) CDS_NOEXCEPT { return pr(); } @@ -78,7 +78,7 @@ namespace cds { } template - bool operator()( Predicate pr ) CDS_NOEXCEPT_( noexcept( Predicate()() ) ) + bool operator()( Predicate pr ) CDS_NOEXCEPT { if ( pr() ) return true; @@ -106,7 +106,7 @@ namespace cds { } template - bool operator()( Predicate pr ) CDS_NOEXCEPT_( noexcept( Predicate()() ) ) + bool operator()( Predicate pr ) CDS_NOEXCEPT { if ( pr() ) return true; @@ -137,7 +137,7 @@ namespace cds { } template - bool operator()( Predicate pr ) CDS_NOEXCEPT_( noexcept( Predicate()() ) ) + bool operator()( Predicate pr ) CDS_NOEXCEPT { if ( pr() ) return true; @@ -264,7 +264,7 @@ namespace cds { } template - bool operator()( Predicate pr ) CDS_NOEXCEPT_( noexcept(Predicate()()) && noexcept( spin_backoff()()) && noexcept( yield_backoff()())) + bool operator()( Predicate pr ) CDS_NOEXCEPT_(noexcept( spin_backoff()()) && noexcept( yield_backoff()())) { if ( m_nExpCur <= m_nExpMax ) { for ( size_t n = 0; n < m_nExpCur; ++n ) { @@ -371,7 +371,7 @@ namespace cds { } template - bool operator()( Predicate pr ) const CDS_NOEXCEPT_( noexcept(Predicate()())) + bool operator()( Predicate pr ) const CDS_NOEXCEPT { for ( unsigned int i = 0; i < m_nTimeout; i += 2 ) { if ( pr() ) diff --git a/cds/intrusive/treiber_stack.h b/cds/intrusive/treiber_stack.h index 99c22cb2..9ccaa87e 100644 --- a/cds/intrusive/treiber_stack.h +++ b/cds/intrusive/treiber_stack.h @@ -391,7 +391,7 @@ namespace cds { namespace intrusive { } // Wait for colliding operation - bkoff( [&op]() -> bool { return op.nStatus.load( atomics::memory_order_acquire ) != op_busy; } ); + bkoff( [&op]() CDS_NOEXCEPT -> bool { return op.nStatus.load( atomics::memory_order_acquire ) != op_busy; } ); { slot_scoped_lock l( slot.lock ); if ( slot.pRec == myRec ) -- 2.34.1