typedef size_t counter_type ; ///< Counter type
public:
/// Returns 0
- counter_type value(atomics::memory_order /*order*/ = atomics::memory_order_relaxed) const
+ static counter_type value(atomics::memory_order /*order*/ = atomics::memory_order_relaxed)
{
return 0;
}
}
/// Dummy increment. Always returns 0
- size_t inc(atomics::memory_order /*order*/ = atomics::memory_order_relaxed)
+ static size_t inc(atomics::memory_order /*order*/ = atomics::memory_order_relaxed)
{
return 0;
}
/// Dummy increment. Always returns 0
- size_t dec(atomics::memory_order /*order*/ = atomics::memory_order_relaxed)
+ static size_t dec(atomics::memory_order /*order*/ = atomics::memory_order_relaxed)
{
return 0;
}
/// Dummy pre-increment. Always returns 0
- size_t operator ++()
+ size_t operator ++() const
{
return 0;
}
/// Dummy post-increment. Always returns 0
- size_t operator ++(int)
+ size_t operator ++(int) const
{
return 0;
}
/// Dummy pre-decrement. Always returns 0
- size_t operator --()
+ size_t operator --() const
{
return 0;
}
/// Dummy post-decrement. Always returns 0
- size_t operator --(int)
+ size_t operator --(int) const
{
return 0;
}
return pr();
}
- void reset() const CDS_NOEXCEPT
+ static void reset() CDS_NOEXCEPT
{}
//@endcond
};
return false;
}
- void reset() const CDS_NOEXCEPT
+ static void reset() CDS_NOEXCEPT
{}
//@endcond
};
return false;
}
- void reset() const CDS_NOEXCEPT
+ static void reset() CDS_NOEXCEPT
{}
//@endcond
};
return false;
}
- void reset() const CDS_NOEXCEPT
+ static void reset() CDS_NOEXCEPT
{}
//@endcond
};
{}
/// Construct object for specified state
- reentrant_spin_lock( bool bLocked ) CDS_NOEXCEPT
+ explicit reentrant_spin_lock( bool bLocked ) CDS_NOEXCEPT_( noexcept(lock()))
: m_spin(0)
, m_OwnerId( OS::c_NullThreadId )
{
}
/// Try to lock the object
- bool try_lock( unsigned int nTryCount ) CDS_NOEXCEPT_( noexcept( try_acquire( nTryCount ) ) )
+ bool try_lock( unsigned int nTryCount ) CDS_NOEXCEPT_( noexcept( try_acquire( nTryCount )))
{
thread_id tid = OS::get_current_thread_id();
if ( try_taken_lock( tid ) )
}
/// Lock the object waits if it is busy
- void lock() CDS_NOEXCEPT
+ void lock() CDS_NOEXCEPT_( noexcept( acquire()))
{
thread_id tid = OS::get_current_thread_id();
if ( !try_taken_lock( tid ) ) {
// Test that all items have been popped
CPPUNIT_MSG( " Test consistency of popped sequence..." );
- size_t nErrors = 0;
for ( size_t nWriter = 0; nWriter < s_nWriterThreadCount; ++nWriter ) {
std::vector<size_t> arrData;
arrData.reserve( m_nThreadPushCount );
- nErrors = 0;
+ size_t nErrors = 0;
for ( size_t nReader = 0; nReader < arrReaders.size(); ++nReader ) {
ReaderIterator it = arrReaders[nReader]->m_WriterData[nWriter].begin();
ReaderIterator itEnd = arrReaders[nReader]->m_WriterData[nWriter].end();
for ( it = arrReaders[nReader]->m_WriterData[nWriter].begin(); it != itEnd; ++it )
arrData.push_back( *it );
}
+
std::sort( arrData.begin(), arrData.end() );
nErrors = 0;
for ( size_t i=1; i < arrData.size(); ++i ) {