Fix GC refactoring bugs
[libcds.git] / cds / gc / impl / dhp_decl.h
index 0f31ce3140e200389f705c5bde1243b1b725dac0..9fd8c8a05b5cea05a99dccd0de3e90030e3992e3 100644 (file)
@@ -155,7 +155,7 @@ namespace cds { namespace gc {
                 Really, the result of <tt> f( toGuard.load() ) </tt> is assigned to the hazard pointer.
             */
             template <typename T, class Func>
-            T protect( atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( f( toGuard.load( atomics::memory_order_relaxed )))
+            T protect( atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( noexcept( Func( atomics::atomic<T>().load(atomics::memory_order_relaxed))))
             {
                 T pCur = toGuard.load(atomics::memory_order_relaxed);
                 T pRet;
@@ -293,7 +293,7 @@ namespace cds { namespace gc {
                 Actually, the result of <tt> f( toGuard.load() ) </tt> is assigned to the hazard pointer.
             */
             template <typename T, class Func>
-            T protect( size_t nIndex, atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( f( toGuard.load( atomics::memory_order_relaxed )))
+            T protect( size_t nIndex, atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( noexcept( Func( atomics::atomic<T>().load(atomics::memory_order_relaxed))))
             {
                 T pRet;
                 do {
@@ -393,11 +393,16 @@ namespace cds { namespace gc {
         /// Checks if count of hazard pointer is no less than \p nCountNeeded
         /**
             The function always returns \p true since the guard count is unlimited for
-            DHP garbage collector.
+            \p gc::DHP garbage collector.
         */
-        static CDS_CONSTEXPR bool check_available_guards( size_t nCountNeeded, bool /*bRaiseException*/ = true )
+        static CDS_CONSTEXPR bool check_available_guards( 
+#ifdef CDS_DOXYGEN_INVOKED
+            size_t nCountNeeded, 
+#else
+            size_t,
+#endif
+            bool /*bRaiseException*/ = true )
         {
-            CDS_UNUSED( nCountNeeded );
             return true;
         }