Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59968 - sandbox/stm/branches/vbe/boost/stm
From: vicente.botet_at_[hidden]
Date: 2010-02-27 19:06:33


Author: viboes
Date: 2010-02-27 19:06:32 EST (Sat, 27 Feb 2010)
New Revision: 59968
URL: http://svn.boost.org/trac/boost/changeset/59968

Log:
Boost.STM/vbe:
* Added traces
* cleanup

Added:
   sandbox/stm/branches/vbe/boost/stm/trace.hpp (contents, props changed)
Text files modified:
   sandbox/stm/branches/vbe/boost/stm/language_like.hpp | 13 ++-----------
   1 files changed, 2 insertions(+), 11 deletions(-)

Modified: sandbox/stm/branches/vbe/boost/stm/language_like.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/language_like.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/language_like.hpp 2010-02-27 19:06:32 EST (Sat, 27 Feb 2010)
@@ -42,13 +42,12 @@
             if (!std::uncaught_exception()) {
                 try {
                     commit();
- //~ BOOST_STM_INFO;
                 } catch(...) {
- BOOST_STM_INFO;
+ BOOST_STM_INFO << std::endl;
                     throw;
                 }
             } else {
- BOOST_STM_ERROR;
+ BOOST_STM_ERROR << std::endl;
             }
         }
     }
@@ -246,7 +245,6 @@
 
 
 #define BOOST_STM_E_RETRY \
- std::cout << __FILE__ << "["<<__LINE__<<"] end" << std::endl;\
                     __boost_stm_ctrl_=boost::stm::detail::none; \
                     break; \
                 } while ((__boost_stm_ctrl_=boost::stm::detail::continue_),false); \
@@ -254,25 +252,18 @@
                 __boost_stm_destr_.release(); \
                 throw; \
             } catch(...) { \
- std::cout << __FILE__ << "["<<__LINE__<<"] catch1" << std::endl;\
                 if (__boost_stm_txn_.forced_to_abort()) {\
- std::cout << __FILE__ << "["<<__LINE__<<"] catch11" << std::endl;\
                     __boost_stm_destr_.release(); \
                 } else {\
                     __boost_stm_destr_.commit();\
                 }\
- std::cout << __FILE__ << "["<<__LINE__<<"] catch12" << std::endl;\
                 throw; \
             } \
             break; \
         } catch (boost::stm::aborted_tx &) { \
- std::cout << __FILE__ << "["<<__LINE__<<"] catch2" << std::endl;\
             if (__boost_stm_txn_.is_nested()) throw; \
- std::cout << __FILE__ << "["<<__LINE__<<"] catch3" << std::endl;\
             do { \
- std::cout << __FILE__ << "["<<__LINE__<<"] catch4" << std::endl;\
                 __boost_stm_ctrl_=boost::stm::detail::break_; \
- std::cout << __FILE__ << "["<<__LINE__<<"] catch5" << std::endl;\
                 try {throw;}catch (boost::stm::aborted_tx &)
 
 

Added: sandbox/stm/branches/vbe/boost/stm/trace.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/trace.hpp 2010-02-27 19:06:32 EST (Sat, 27 Feb 2010)
@@ -0,0 +1,44 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Justin E. Gottchlich 2009.
+// (C) Copyright Vicente J. Botet Escriba 2009.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STM_TRACE__HPP
+#define BOOST_STM_TRACE__HPP
+
+//-----------------------------------------------------------------------------
+#include <iostream>
+//-----------------------------------------------------------------------------
+//~ << BOOST_CURRENT_FUNCTION
+//#define BOOST_STM_USE_TRACE_INFO 1
+#ifdef BOOST_STM_USE_TRACE_INFO
+#define BOOST_STM_INFO if (false); else \
+ std::cout << "*** INFO: " <<__FILE__ << "["<<__LINE__<<"]"
+
+#else
+#define BOOST_STM_INFO if (true); else \
+ std::cout <<__FILE__ << "["<<__LINE__<<"]"
+#endif
+
+#define BOOST_STM_USE_TRACE_ERROR 1
+#ifdef BOOST_STM_USE_TRACE_ERROR
+#define BOOST_STM_ERROR if (false); else \
+ std::cout << "***** ERROR: " <<__FILE__ << "["<<__LINE__<<"]"
+
+#else
+#define BOOST_STM_ERROR if (true); else \
+ std::cout std::cout << "***** ERROR: " <<__FILE__ << "["<<__LINE__<<"]"
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+#endif // BOOST_STM_TRACE__HPP
+
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk