Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59909 - in sandbox/stm/branches/vbe/libs/stm: example/tx test
From: vicente.botet_at_[hidden]
Date: 2010-02-25 12:18:09


Author: viboes
Date: 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
New Revision: 59909
URL: http://svn.boost.org/trac/boost/changeset/59909

Log:
Boost.STM/vbe:
* Adapt examples to language-like macros interface changes
Text files modified:
   sandbox/stm/branches/vbe/libs/stm/example/tx/bank.cpp | 62 +++++++++++++++++++++----------
   sandbox/stm/branches/vbe/libs/stm/example/tx/list.cpp | 77 +++++++++++++++++++++++++++++----------
   sandbox/stm/branches/vbe/libs/stm/example/tx/list_sp.cpp | 66 ++++++++++++++++++++++-----------
   sandbox/stm/branches/vbe/libs/stm/example/tx/numeric.cpp | 46 +++++++++++-----------
   sandbox/stm/branches/vbe/libs/stm/test/Jamfile.v2 | 3 +
   sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.h | 8 +++
   sandbox/stm/branches/vbe/libs/stm/test/testLinkedList.h | 8 +++
   sandbox/stm/branches/vbe/libs/stm/test/testLinkedListBig.h | 8 +++
   sandbox/stm/branches/vbe/libs/stm/test/testLinkedListWithLocks.h | 8 +++
   sandbox/stm/branches/vbe/libs/stm/test/testPerson.h | 8 +++
   sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.h | 8 +++
   11 files changed, 208 insertions(+), 94 deletions(-)

Modified: sandbox/stm/branches/vbe/libs/stm/example/tx/bank.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/example/tx/bank.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/example/tx/bank.cpp 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -36,20 +36,21 @@
     }
 
     void Deposit(int amount) {
- BOOST_STM_TRANSACTION(_) {
+ BOOST_STM_E_TRANSACTION {
             balance_ += amount;
- } BOOST_STM_RETRY
+ } BOOST_STM_E_END_TRANSACTION;
     }
     int Withdraw(int amount) {
- BOOST_STM_TRANSACTION(_) {
+ BOOST_STM_E_TRANSACTION {
             balance_ -= amount;
- } BOOST_STM_RETRY
+ } BOOST_STM_E_END_TRANSACTION;
         return amount;
     }
     int Balance() const {
         BOOST_STM_E_TRANSACTION {
+ std::cout << __FILE__ << "["<<__LINE__<<"] return" << std::endl;\
             BOOST_STM_E_RETURN(balance_);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
         return 0;
     }
@@ -100,16 +101,16 @@
         thread_initializer thi;
         for(int i=10; i>0;--i)
         {
- BOOST_STM_OUTER_TRANSACTION(_) {
- int amount=random() % 1000;
- int acc1=random() % bank_->accounts.size();
- int acc2=random() % bank_->accounts.size();
- bank_->accounts[acc1]->Withdraw(amount);
- bank_->accounts[acc2]->Deposit(amount+1);
- } BOOST_STM_RETRY
- catch(...) {
- cerr << "aborted"<< endl;
+ try {
+ BOOST_STM_OUTER_TRANSACTION(_) {
+ int amount=random() % 1000;
+ int acc1=random() % bank_->accounts.size();
+ int acc2=random() % bank_->accounts.size();
+ bank_->accounts[acc1]->Withdraw(amount);
+ bank_->accounts[acc2]->Deposit(amount+1);
+ } BOOST_STM_RETRY
             }
+ CATCH_AND_PRINT_ALL
         }
     }
     tx::pointer<const Bank> bank_;
@@ -133,9 +134,12 @@
 //tx::tx_ptr<BankAccount> a;
 void account_withdraw_thr() {
     thread_initializer thi;
- BOOST_STM_OUTER_TRANSACTION(_) {
+ try {
+ BOOST_STM_E_TRANSACTION {
         a->Withdraw(10);
- } BOOST_STM_RETRY
+ } BOOST_STM_E_END_TRANSACTION;
+ }
+ CATCH_AND_PRINT_ALL
 }
 void account_withdraw() {
     BOOST_STM_OUTER_TRANSACTION(_) {
@@ -145,9 +149,14 @@
 
 void account_deposit_thr() {
     thread_initializer thi;
- BOOST_STM_OUTER_TRANSACTION(_) {
+ try {
+ //~ BOOST_STM_OUTER_TRANSACTION(_) {
+ BOOST_STM_E_TRANSACTION {
         a->Deposit(10);
- } BOOST_STM_RETRY
+ } BOOST_STM_E_END_TRANSACTION;
+ //~ } BOOST_STM_RETRY
+ }
+ CATCH_AND_PRINT_ALL
 }
 void account_deposit() {
     BOOST_STM_OUTER_TRANSACTION(_) {
@@ -166,8 +175,9 @@
         int res = (a->Balance()==10?0:1);
         //BUG assertion "pthread_mutex_lock(&lockable)==0&&"synchro::lock<pthread_mutex_t>"" failed: file "../../../boost/synchro/pthread/mutex.hpp", line 46
         //~ BOOST_STM_TX_DELETE_PTR(_, a.value());
+ std::cout << __FILE__ << "["<<__LINE__<<"] return" << std::endl;
         BOOST_STM_E_RETURN(res);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return 1;
 }
 
@@ -182,8 +192,9 @@
     BOOST_STM_E_TRANSACTION {
         int res = (a->Balance()==-10?0:1);
         //~ BOOST_STM_TX_DELETE_PTR(_, a.value());
+ std::cout << __FILE__ << "["<<__LINE__<<"] return" << std::endl;
         BOOST_STM_E_RETURN(res);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return 1;
 }
 
@@ -204,8 +215,9 @@
     BOOST_STM_E_TRANSACTION {
         int res = (a->Balance()==0?0:1);
         //~ BOOST_STM_TX_DELETE_PTR(_, a.value());
+ std::cout << __FILE__ << "["<<__LINE__<<"] return" << std::endl;
         BOOST_STM_E_RETURN(res);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return 1;
 }
 
@@ -272,7 +284,13 @@
 }
 
 
+void term_hd() {
+ std::cout << "****************** ERROR: "<< __FILE__ << "["<<__LINE__<<"] term_hd"<< std::endl;
+ std::abort();
+}
 int main() {
+ try {
+ std::terminate_handler x = std::set_terminate(term_hd);
     transaction::enable_dynamic_priority_assignment();
     transaction::do_deferred_updating();
     transaction::initialize();
@@ -288,5 +306,7 @@
     res+=test_bank_2();
 
     return res;
+ }
+ CATCH_AND_PRINT_ALL
 
 }

Modified: sandbox/stm/branches/vbe/libs/stm/example/tx/list.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/example/tx/list.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/example/tx/list.cpp 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -84,13 +84,13 @@
     std::size_t size() const {
         BOOST_STM_E_TRANSACTION {
             BOOST_STM_E_RETURN(size_);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
         //~ BOOST_STM_TRANSACTION(_) {
             //~ BOOST_STM_RETURN(_, size_);
         //~ } BOOST_STM_RETRY
         BOOST_STM_E_TRANSACTION {
             BOOST_STM_E_RETURN(size_);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
         //~ BOOST_STM_TRANSACTION(_) {
             //~ BOOST_STM_RETURN(_, size_);
         //~ } BOOST_STM_RETRY
@@ -100,12 +100,33 @@
     //--------------------------------------------------------------------------
     // find the location to insert the node. if the value already exists, fail
     //--------------------------------------------------------------------------
+ void insert_e(const T& val) {
+ BOOST_STM_TRANSACTION(_) {
+ list_node<T> * prev = head_;
+ list_node<T> * curr = prev->next_;
+ while (curr!=0) {
+ if (curr->value_ == val) BOOST_STM_TX_RETURN_NOTHING(_);
+ //~ if (curr->value_ == val) return;
+ else if (curr->value_ > val) BOOST_STM_BREAK(_);
+ prev = curr;
+ curr = curr->next_;
+ }
+ if (curr==0 || (curr->value_ > val)) {
+ prev->next_=BOOST_STM_TX_NEW_PTR(_,list_node<T>(val, curr));
+ ++size_;
+ }
+ } BOOST_STM_RETRY
+ }
+
     void insert(const T& val) {
         BOOST_STM_E_TRANSACTION {
             list_node<T> * prev = head_;
             list_node<T> * curr = prev->next_;
             while (curr!=0) {
- if (curr->value_ == val) BOOST_STM_E_RETURN_NOTHING;
+ if (curr->value_ == val) {
+ std::cout << __FILE__ << "["<<__LINE__<<"] return" << std::endl;\
+ BOOST_STM_E_RETURN_NOTHING;
+ }
                 //~ if (curr->value_ == val) return;
                 else if (curr->value_ > val) break;
                 prev = curr;
@@ -115,10 +136,7 @@
                 prev->next_=BOOST_STM_E_NEW_PTR(list_node<T>(val, curr));
                 ++size_;
             }
- } BOOST_STM_E_END_TRANSACTION
- //~ catch (...) {
- //~ cerr << __LINE__ << " * insert" << endl;
- //~ }
+ } BOOST_STM_E_END_TRANSACTION;
    }
 
     // search function
@@ -130,7 +148,7 @@
                 curr = curr->next_;
             }
             BOOST_STM_E_RETURN((curr) && (curr->value_ == val));
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
         return false;
     }
 
@@ -172,20 +190,20 @@
         cerr << " create size " << l.size() << endl;
     } BOOST_STM_RETRY
     catch (...) {
- cerr << "aborted" << endl;
+ std::cout << "*** ERROR: "<< __FILE__ << "["<<__LINE__<<"] catch" << std::endl;
     }
 }
 bool check_size(std::size_t val) {
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(l.size()==val);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 bool check_lookup(int val) {
     BOOST_STM_E_TRANSACTION {
         //cerr << " check_lookup " << l.lookup(val) << endl;
         BOOST_STM_E_RETURN(l.lookup(val));
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -198,21 +216,32 @@
 }
 void insert1_th() {
     thread_initializer thi;
- BOOST_STM_OUTER_TRANSACTION(_) {
- l.insert(1);
- } BOOST_STM_RETRY
+ try {
+ BOOST_STM_E_TRANSACTION {
+ l.insert(1);
+ } BOOST_STM_E_END_TRANSACTION;
+ }
+ CATCH_AND_PRINT_ALL
 }
 void insert2_th() {
     thread_initializer thi;
- BOOST_STM_OUTER_TRANSACTION(_) {
- l.insert(2);
- } BOOST_STM_RETRY
+ try {
+ //~ BOOST_STM_OUTER_TRANSACTION(_) {
+ BOOST_STM_E_TRANSACTION {
+ l.insert(2);
+ } BOOST_STM_E_END_TRANSACTION;
+ //~ } BOOST_STM_RETRY
+ }
+ CATCH_AND_PRINT_ALL
 }
 void insert3_th() {
     thread_initializer thi;
+ try {
     BOOST_STM_OUTER_TRANSACTION(_) {
         l.insert(3);
     } BOOST_STM_RETRY
+ }
+ CATCH_AND_PRINT_ALL
 }
 
 bool remove(int val) {
@@ -230,7 +259,7 @@
     } BOOST_STM_RETRY
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(n.next_->value_==10);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -240,7 +269,7 @@
     } BOOST_STM_RETRY
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(n.next_->value_==12);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -253,7 +282,7 @@
     } BOOST_STM_RETRY
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(n.next_->value_==10);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -300,7 +329,13 @@
     return fails;
 }
 
+void term_hd() {
+ std::cout << "****************** ERROR: "<< __FILE__ << "["<<__LINE__<<"] term_hd"<< std::endl;
+ std::abort();
+}
 int main() {
+ try {
+ std::terminate_handler x = std::set_terminate(term_hd);
     transaction::enable_dynamic_priority_assignment();
     transaction::do_deferred_updating();
     transaction::initialize();
@@ -308,5 +343,7 @@
 
 
     return test_all();
+ }
+ CATCH_AND_PRINT_ALL
 
 }

Modified: sandbox/stm/branches/vbe/libs/stm/example/tx/list_sp.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/example/tx/list_sp.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/example/tx/list_sp.cpp 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -68,7 +68,7 @@
     std::size_t size() const {
         BOOST_STM_E_TRANSACTION {
             BOOST_STM_E_RETURN(size_);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
         return 0;
     }
 
@@ -80,7 +80,10 @@
             read_ptr<list_node<T> > prev(BOOST_STM_CURRENT, head_);
             read_ptr<list_node<T> > curr(BOOST_STM_CURRENT, prev->next_);
             while (curr!=0) {
- if (curr->value_ == val) return;
+ if (curr->value_ == val) {
+ std::cout << __FILE__ << "["<<__LINE__<<"] return" << std::endl;\
+ BOOST_STM_E_RETURN_NOTHING;
+ }
                 else if (curr->value_ > val) break;
                 prev = curr;
                 curr = curr->next_;
@@ -89,7 +92,7 @@
                 make_write_ptr<static_poly>(prev)->next_=BOOST_STM_E_NEW_PTR(list_node<T>(val, curr.get()));
                 ++(make_write_ptr<static_poly>(BOOST_STM_CURRENT, this)->size_);
             }
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     }
 
     // search function
@@ -101,7 +104,7 @@
                 curr = curr->next_;
             }
             BOOST_STM_E_RETURN((curr) && (curr->value_ == val));
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
         return false;
     }
 
@@ -146,20 +149,20 @@
         cout << " create size " << l.size() << endl;
     } BOOST_STM_RETRY
     catch (...) {
- cout << "aborted" << endl;
+ std::cout << "*** ERROR: "<< __FILE__ << "["<<__LINE__<<"] catch" << std::endl;
     }
 }
 bool check_size(std::size_t val) {
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(l.size()==val);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 bool check_lookup(int val) {
     //BOOST_STM_TRANSACTION(_) {
         return (l.lookup(val));
     //} BOOST_STM_RETRY
- return false;
+ //~ return false;
 }
 
 bool insert1() {
@@ -172,15 +175,21 @@
 }
 void insert1_th() {
     thread_initializer thi;
- BOOST_STM_TRANSACTION(_) {
- l.insert(1);
- } BOOST_STM_RETRY
+ try {
+ BOOST_STM_E_TRANSACTION {
+ l.insert(1);
+ } BOOST_STM_E_END_TRANSACTION;
+ }
+ CATCH_AND_PRINT_ALL
 }
 void insert2_th() {
     thread_initializer thi;
- BOOST_STM_TRANSACTION(_) {
- l.insert(2);
- } BOOST_STM_RETRY
+ try {
+ BOOST_STM_E_TRANSACTION {
+ l.insert(2);
+ } BOOST_STM_E_END_TRANSACTION;
+ }
+ CATCH_AND_PRINT_ALL
 }
 
 void remove2() {
@@ -192,18 +201,21 @@
 
 void insert3_th() {
     thread_initializer thi;
- BOOST_STM_TRANSACTION(_) {
- l.insert(3);
- } BOOST_STM_RETRY
+ try {
+ BOOST_STM_E_TRANSACTION {
+ l.insert(3);
+ } BOOST_STM_E_END_TRANSACTION;
+ }
+ CATCH_AND_PRINT_ALL
 }
 bool n1() {
- BOOST_STM_TRANSACTION(_) {
+ BOOST_STM_E_TRANSACTION {
         int val = 10;
- n.next_=BOOST_STM_TX_NEW_PTR(_,test::list_node<int>(val, 0));
- } BOOST_STM_RETRY
+ n.next_=BOOST_STM_E_NEW_PTR(test::list_node<int>(val, 0));
+ } BOOST_STM_E_END_TRANSACTION;
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN (n.next_->value_==10);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -213,7 +225,7 @@
     } BOOST_STM_RETRY
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN (n.next_->value_==12);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -227,7 +239,7 @@
     } BOOST_STM_RETRY
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN (n.next_->value_==10);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -238,7 +250,7 @@
     fails= fails || !n2();
     fails= fails || !n3();
     fails= fails || !check_size(0);
- //fails= fails || !insert1();
+ //~ //fails= fails || !insert1();
     thread th1(insert1_th);
     thread th2(insert2_th);
     thread th3(insert2_th);
@@ -261,12 +273,20 @@
     return fails;
 }
 
+void term_hd() {
+ std::cout << "****************** ERROR: "<< __FILE__ << "["<<__LINE__<<"] term_hd"<< std::endl;
+ std::abort();
+}
 int main() {
+ try {
+ std::terminate_handler x = std::set_terminate(term_hd);
     transaction::enable_dynamic_priority_assignment();
     transaction::do_deferred_updating();
     transaction::initialize();
     thread_initializer thi;
 
     return test_all();
+ }
+ CATCH_AND_PRINT_ALL
 
 }

Modified: sandbox/stm/branches/vbe/libs/stm/example/tx/numeric.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/example/tx/numeric.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/example/tx/numeric.cpp 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -129,7 +129,7 @@
     }
     BOOST_STM_E_TRANSACTION
         BOOST_STM_E_RETURN(counter<counter2) ;
- BOOST_STM_E_END_TRANSACTION
+ BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -142,7 +142,7 @@
     try{
         BOOST_STM_TRANSACTION(_) {
             counter=1;
- throw 1;
+ throw "1";
         } BOOST_STM_END_TRANSACTION(_)
     } catch (...) {}
 
@@ -156,18 +156,18 @@
     reset();
     BOOST_STM_E_TRANSACTION {
         counter=0;
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
     try{
         BOOST_STM_E_TRANSACTION {
             counter=1;
- throw 1;
- } BOOST_STM_E_END_TRANSACTION
+ throw "1";
+ } BOOST_STM_E_END_TRANSACTION;
     } catch (...) {}
 
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(counter==0);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
     return true;
 }
@@ -178,13 +178,13 @@
     reset();
     BOOST_STM_E_TRANSACTION {
         counter=0; counter2=0;
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
     try{
         BOOST_STM_TRANSACTION(_) {
             counter=1;
             BOOST_STM_TRANSACTION(__) {
- throw 1;
+ throw "1";
             } BOOST_STM_END_TRANSACTION(_)
             catch (...){throw;}
             counter=3;
@@ -203,22 +203,22 @@
     reset();
     BOOST_STM_E_TRANSACTION {
         counter=0; counter2=0;
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
     try{
         BOOST_STM_E_TRANSACTION {
             counter=1;
             BOOST_STM_E_TRANSACTION {
                 counter=2;
- throw 1;
- } BOOST_STM_E_END_TRANSACTION
+ throw "1";
+ } BOOST_STM_E_END_TRANSACTION;
             counter=3;
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     } catch (...) {}
 
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(counter==0);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
     return false;
 }
@@ -229,12 +229,12 @@
         counter=1;
         BOOST_STM_E_TRANSACTION {
             counter2=2;
- } BOOST_STM_E_END_TRANSACTION
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
+ } BOOST_STM_E_END_TRANSACTION;
 
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN((counter==1) && (counter2==2));
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
     return false;
 }
@@ -247,11 +247,11 @@
             counter2=counter;
             continue;
             counter2=3;
- } BOOST_STM_E_END_TRANSACTION_IN_LOOP
+ } BOOST_STM_E_END_TRANSACTION_IN_LOOP;
     }
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN((counter==1) && (counter2==1) && (counter==counter2)) ;
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
 
     return false;
 }
@@ -264,11 +264,11 @@
             counter2=2;
             break;
             counter2=0;
- } BOOST_STM_E_END_TRANSACTION_IN_LOOP
+ } BOOST_STM_E_END_TRANSACTION_IN_LOOP;
     }
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(counter<counter2);
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 
@@ -291,7 +291,7 @@
     } BOOST_STM_RETRY
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_RETURN(c==counter2) ;
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
     return false;
 }
 bool test_par() {
@@ -321,8 +321,8 @@
 bool test_twice_e() {
     BOOST_STM_E_TRANSACTION {
         BOOST_STM_E_TRANSACTION {
- } BOOST_STM_E_END_TRANSACTION
- } BOOST_STM_E_END_TRANSACTION
+ } BOOST_STM_E_END_TRANSACTION;
+ } BOOST_STM_E_END_TRANSACTION;
 
     return true;
 }

Modified: sandbox/stm/branches/vbe/libs/stm/test/Jamfile.v2
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/Jamfile.v2 (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/Jamfile.v2 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -76,6 +76,7 @@
             [ run stm : -bench isolated_int_lock_in_tx -def -threads 4 -inserts 100 -latm tx : : : isolated_int_lock_in_tx_def_tx_t4_i100 ]
 
 
+ ########### deadlock sometimes. 2010/02/22
             [ run stm : -bench isolated_composed_int_lock2 -def -threads 2 -inserts 100 -latm tx : : : isolated_composed_int_lock2_def_tx_t2_i100 ]
 
             [ run stm : -bench irrevocable_int -def -threads 2 -inserts 100 : : : irrevocable_int_def_t2_i100 ]
@@ -134,7 +135,7 @@
             ########### fails with CHECK all-modes
             #/bin/sh: line 4: 3764 Aborted (core dumped) "bin/tx_linear_lock_dir_t2.test/gcc-3.4.4/debug/threading-multi/tx_linear_lock_dir_t2.exe" > "bin/tx_linear_lock_dir_t2.test/gcc-3.4.4/debug/threading-multi/tx_linear_lock_dir_t2.output" 2>&1
             #assertion "res==0" failed: file "../../../boost/synchro/pthread/mutex.hpp", line 40
- ########### deadlock. without CHECK
+ ########### deadlock. without CHECK 2010/02/22
             [ run stm : -bench tx_linear_lock -dir -threads 2 -inserts 100 -latm full : : : tx_linear_lock_dir_full_t2_i100 ]
             ########### deadlock
             #[ run stm : -bench tx_linear_lock -dir -threads 4 -inserts 100 -latm full : : : tx_linear_lock_dir_full_t4_i100 ]

Modified: sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.h
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.h (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.h 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -104,7 +104,13 @@
       head_.value() = T();
    }
 
- ~LinkedList() { quick_clear(); }
+ ~LinkedList() {
+ try {
+ quick_clear();
+ } catch (...) {
+ BOOST_STM_ERROR;
+ }
+}
 
    mutex_type* get_list_lock() { return &list_lock_; }
 

Modified: sandbox/stm/branches/vbe/libs/stm/test/testLinkedList.h
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testLinkedList.h (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testLinkedList.h 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -95,7 +95,13 @@
 
    LinkedList() { head_.value() = T(); }
 
- ~LinkedList() { quick_clear(); }
+ ~LinkedList() {
+ try {
+ quick_clear();
+ } catch (...) {
+ BOOST_STM_ERROR;
+ }
+ }
 
    bool move(list_node<T> const &node1, list_node<T> const &node2)
    {

Modified: sandbox/stm/branches/vbe/libs/stm/test/testLinkedListBig.h
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testLinkedListBig.h (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testLinkedListBig.h 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -84,7 +84,13 @@
 
    LinkedList() { head_.value() = T(); }
 
- ~LinkedList() { quick_clear(); }
+ ~LinkedList() {
+ try {
+ quick_clear();
+ } catch (...) {
+ BOOST_STM_ERROR;
+ }
+ }
 
    bool move(list_node<T> const &node1, list_node<T> const &node2)
    {

Modified: sandbox/stm/branches/vbe/libs/stm/test/testLinkedListWithLocks.h
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testLinkedListWithLocks.h (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testLinkedListWithLocks.h 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -106,7 +106,13 @@
       head_.value() = T();
    }
 
- ~LinkedList() { quick_clear(); }
+ ~LinkedList() {
+ try {
+ quick_clear();
+ } catch (...) {
+ BOOST_STM_ERROR;
+ }
+ }
 
    mutex_type* get_list_lock() { return &list_lock_; }
 

Modified: sandbox/stm/branches/vbe/libs/stm/test/testPerson.h
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testPerson.h (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testPerson.h 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -38,7 +38,13 @@
       resize(kMaxArrSize);
    }
 
- ~named_array() { delete [] name_; delete [] array_; size_ = 0; }
+ ~named_array() {
+ try {
+ delete [] name_; delete [] array_; size_ = 0;
+ } catch (...) {
+ BOOST_STM_ERROR;
+ }
+ }
 
    char const * const name() const { return name_; }
    T* array() { return array_; }

Modified: sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.h
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.h (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.h 2010-02-25 12:18:07 EST (Thu, 25 Feb 2010)
@@ -109,7 +109,13 @@
       head_.value() = T();
    }
 
- ~LinkedList() { quick_clear(); }
+ ~LinkedList() {
+ try {
+ quick_clear();
+ } catch (...) {
+ BOOST_STM_ERROR;
+ }
+ }
 
    mutex_type* get_list_lock() { return &list_lock_; }
 


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