Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59827 - sandbox/transaction/boost/transact
From: strasser_at_[hidden]
Date: 2010-02-21 17:08:55


Author: stefans
Date: 2010-02-21 17:08:54 EST (Sun, 21 Feb 2010)
New Revision: 59827
URL: http://svn.boost.org/trac/boost/changeset/59827

Log:
 - transaction restart instead of reconstruction
 - enforce single statement between begin_transaction and end_transaction
 - allow control statements in retry{} clause
Text files modified:
   sandbox/transaction/boost/transact/basic_transaction.hpp | 21 +++++++++++++++++----
   1 files changed, 17 insertions(+), 4 deletions(-)

Modified: sandbox/transaction/boost/transact/basic_transaction.hpp
==============================================================================
--- sandbox/transaction/boost/transact/basic_transaction.hpp (original)
+++ sandbox/transaction/boost/transact/basic_transaction.hpp 2010-02-21 17:08:54 EST (Sun, 21 Feb 2010)
@@ -155,13 +155,14 @@
 #define BOOST_TRANSACT_BASIC_BEGIN_TRANSACTION(TXMGR) \
         { \
                 int ___control; \
+ boost::transact::basic_transaction<TXMGR> ___tx; \
                 while(true){ \
                         try{ \
- boost::transact::basic_transaction<TXMGR> ___tx; \
                                 boost::transact::detail::commit_on_destruction<TXMGR> ___commit(___tx); \
                                 try{ \
                                         do{ \
- ___control=1;
+ ___control=1; \
+ if(false);else
 
 #define BOOST_TRANSACT_BASIC_RETRY(TXMGR) \
                                                 ___control=0; \
@@ -174,18 +175,30 @@
                                 break; \
                         }catch(boost::transact::isolation_exception &___i){ \
                                 ___i.unwind<TXMGR>(); \
- ___control=0;
+ do{ \
+ ___control=1; \
+ if(false);else
 
 #define BOOST_TRANSACT_BASIC_END_RETRY(TXMGR) \
+ ___control=0; \
+ break; \
+ }while((___control=2),false); \
                         } \
+ BOOST_ASSERT(___control == 0); \
+ ___tx.restart();
                 }; \
                 BOOST_ASSERT(___control == 0); \
         }void()
 
 #define BOOST_TRANSACT_BASIC_END_RETRY_IN_LOOP(TXMGR) \
+ ___control=0; \
+ break; \
+ }while((___control=2),false); \
                         } \
+ if(___control != 0) break; }
+ ___tx.restart();
                 }; \
- if(___control > 0){ \
+ if(___control != 0){ \
                         if(___control==1) break; \
                         else continue; \
                 } \


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