Fixed issues found by Cppcheck
[libcds.git] / cds / sync / spinlock.h
index 274c82fb1bd4ac4ba1e79157b5124af78d8934e9..794271a8fec7e1e751827d8f9248299a2a9475a0 100644 (file)
@@ -255,7 +255,7 @@ namespace cds {
             {}
 
             /// 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 )
             {
@@ -287,7 +287,7 @@ namespace cds {
             }
 
             /// 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 ) )
@@ -300,7 +300,7 @@ namespace cds {
             }
 
             /// 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 ) ) {