[rhmessaging-commits] rhmessaging commits: r3106 - store/trunk/cpp/lib/jrnl.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Feb 4 14:14:29 EST 2009


Author: kpvdr
Date: 2009-02-04 14:14:29 -0500 (Wed, 04 Feb 2009)
New Revision: 3106

Modified:
   store/trunk/cpp/lib/jrnl/jexception.hpp
Log:
Changed PTHREAD_CHK macro to abort instead of throwing an exception. This will allow the stack trace for occurrences of BZ484048 to be captured.

Modified: store/trunk/cpp/lib/jrnl/jexception.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jexception.hpp	2009-02-04 15:05:05 UTC (rev 3105)
+++ store/trunk/cpp/lib/jrnl/jexception.hpp	2009-02-04 19:14:29 UTC (rev 3106)
@@ -43,6 +43,8 @@
 }
 }
 
+#include <cstdio>
+#include <cstdlib>
 #include <cstring>
 #include <exception>
 #include <string>
@@ -60,10 +62,17 @@
 
 #define PTHREAD_CHK(err, pfn, cls, fn) if(err != 0) { \
     std::ostringstream oss; \
-    oss << pfn << " failed: " << FORMAT_SYSERR(err); \
-    throw jexception(jerrno::JERR__PTHREAD, oss.str(), cls, fn); \
+    oss << cls << "::" << fn << "(): " << pfn; \
+    errno = err; \
+    ::perror(oss.str().c_str()); \
+    ::abort(); \
     }
 
+#define ASSERT(cond, msg) if(cond == 0) { \
+    std::cerr << msg << std::endl; \
+    ::abort(); \
+    }
+
 namespace mrg
 {
 namespace journal




More information about the rhmessaging-commits mailing list