|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59756 - sandbox/stm/branches/vbe/libs/stm/example/tx
From: vicente.botet_at_[hidden]
Date: 2010-02-18 21:31:28
Author: viboes
Date: 2010-02-18 21:31:27 EST (Thu, 18 Feb 2010)
New Revision: 59756
URL: http://svn.boost.org/trac/boost/changeset/59756
Log:
Boost.STM/vbe:
* Test BOOST_STM_RETURN with variable of type mixin
* cleanup
Text files modified:
sandbox/stm/branches/vbe/libs/stm/example/tx/list.cpp | 13 +++++++++----
sandbox/stm/branches/vbe/libs/stm/example/tx/list_sp.cpp | 5 +----
sandbox/stm/branches/vbe/libs/stm/example/tx/numeric.cpp | 1 -
3 files changed, 10 insertions(+), 9 deletions(-)
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-18 21:31:27 EST (Thu, 18 Feb 2010)
@@ -82,9 +82,12 @@
~list() { }
std::size_t size() const {
- BOOST_STM_B_TRANSACTION(_) {
- return size_;
- } BOOST_STM_RETRY_END(_)
+ //~ BOOST_STM_B_TRANSACTION(_) {
+ //~ return size_;
+ //~ } BOOST_STM_RETRY_END(_)
+ BOOST_STM_TRANSACTION(_) {
+ BOOST_STM_RETURN(size_);
+ } BOOST_STM_RETRY
return 0;
}
@@ -167,6 +170,7 @@
}
bool check_size(std::size_t val) {
BOOST_STM_B_TRANSACTION(_) {
+ std::cout<< __FILE__<<"["<<__LINE__<<"]"<<std::endl;
return (l.size()==val);
} BOOST_STM_RETRY_END(_)
return false;
@@ -255,7 +259,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);
@@ -281,6 +285,7 @@
transaction::initialize();
thread_initializer thi;
+
return test_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-18 21:31:27 EST (Thu, 18 Feb 2010)
@@ -242,18 +242,16 @@
fails= fails || !n3();
fails= fails || !check_size(0);
//fails= fails || !insert1();
-#if 1
thread th1(insert1_th);
thread th2(insert2_th);
thread th3(insert2_th);
thread th4(insert3_th);
- cout << __LINE__ << " * test_all" << endl;
th1.join();
th2.join();
th3.join();
th4.join();
- cout << __LINE__ << " * test_all" << endl;
+
fails= fails || !check_lookup(1);
fails= fails || !check_lookup(2);
fails= fails || !check_lookup(3);
@@ -263,7 +261,6 @@
fails= fails || check_lookup(2);
fails= fails || !check_lookup(3);
fails= fails || !check_size(2);
-#endif
return fails;
}
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-18 21:31:27 EST (Thu, 18 Feb 2010)
@@ -66,7 +66,6 @@
label1:
BOOST_STM_TRANSACTION(_) {
counter=2;
- //assert(counter==counter2);
BOOST_STM_TX_RETURN(_, (counter==counter2));
} BOOST_STM_RETRY
return false;
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