replace cds::gc::too_few_hazard_pointers exception with std::overflow
authorkhizmax <khizmax@gmail.com>
Fri, 14 Nov 2014 10:18:15 +0000 (13:18 +0300)
committerkhizmax <khizmax@gmail.com>
Fri, 14 Nov 2014 10:18:15 +0000 (13:18 +0300)
cds/gc/exception.h [deleted file]
cds/gc/hp_decl.h
cds/gc/hzp/hzp.h
projects/Win/vc12/cds.vcxproj
projects/Win/vc12/cds.vcxproj.filters

diff --git a/cds/gc/exception.h b/cds/gc/exception.h
deleted file mode 100644 (file)
index 797bbb6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//$$CDS-header$$
-
-#ifndef __CDS_GC_EXCEPTION_H
-#define __CDS_GC_EXCEPTION_H
-
-#include <cds/details/defs.h>
-
-namespace cds { namespace gc {
-
-    /// %Exception "Too few hazard pointers"
-    CDS_DECLARE_EXCEPTION( too_few_hazard_pointers, "Too few hazard pointers" );
-
-}} // namespace cds::gc
-
-#endif // #ifndef __CDS_GC_EXCEPTION_H
index 46df3a14758f3f3f6b326a4f2b7471fd95152952..2b92a5408129252d479367d128cbab1d19c344b7 100644 (file)
@@ -3,6 +3,7 @@
 #ifndef __CDS_GC_HP_DECL_H
 #define __CDS_GC_HP_DECL_H
 
+#include <stdexcept>    // overflow_error
 #include <cds/gc/hzp/hzp.h>
 #include <cds/details/marked_ptr.h>
 
@@ -372,14 +373,15 @@ namespace cds { namespace gc {
 
         /// Checks if count of hazard pointer is no less than \p nCountNeeded
         /**
-            If \p bRaiseException is \p true (that is the default), the function raises an exception gc::too_few_hazard_pointers
+            If \p bRaiseException is \p true (that is the default), the function raises 
+            an \p std::overflow_error exception "Too few hazard pointers"
             if \p nCountNeeded is more than the count of hazard pointer per thread.
         */
         static bool check_available_guards( size_t nCountNeeded, bool bRaiseException = true )
         {
             if ( hzp::GarbageCollector::instance().getHazardPointerCount() < nCountNeeded ) {
                 if ( bRaiseException )
-                    throw cds::gc::too_few_hazard_pointers();
+                    throw std::overflow_error( "Too few hazard pointers" );
                 return false;
             }
             return true;
index a3ccf66c287f0f5a15abfc6a2c48a1e3dd35faec..b92a5a41b96d87ceceff14541926877c32637db0 100644 (file)
@@ -6,7 +6,6 @@
 #include <vector>
 #include <cds/cxx11_atomic.h>
 #include <cds/os/thread.h>
-#include <cds/gc/exception.h>
 #include <cds/gc/hzp/details/hp_fwd.h>
 #include <cds/gc/hzp/details/hp_alloc.h>
 #include <cds/gc/hzp/details/hp_retired.h>
index c82a2cb93e752f5cf3f38cf2bcdb428dfedd32c4..b9b19b9396fc84a78f615d5221136044f3d52e3f 100644 (file)
     <ClInclude Include="..\..\..\cds\details\static_functor.h" />\r
     <ClInclude Include="..\..\..\cds\gc\all.h" />\r
     <ClInclude Include="..\..\..\cds\gc\dhp.h" />\r
-    <ClInclude Include="..\..\..\cds\gc\exception.h" />\r
     <ClInclude Include="..\..\..\cds\gc\gc_fwd.h" />\r
     <ClInclude Include="..\..\..\cds\gc\guarded_ptr.h" />\r
     <ClInclude Include="..\..\..\cds\gc\hp_decl.h" />\r
index e7b7f7ea9f456bc54591348a1e209d427fd147ff..893eb2df835d69346e4a277a4d26a49e9315d48c 100644 (file)
     <ClInclude Include="..\..\..\cds\container\cuckoo_map.h">\r
       <Filter>Header Files\cds\container</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\cds\gc\exception.h">\r
-      <Filter>Header Files\cds\gc</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\..\..\cds\intrusive\skip_list_hp.h">\r
       <Filter>Header Files\cds\intrusive</Filter>\r
     </ClInclude>\r