Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58781 - in sandbox/stm/branches/vbe/libs/stm: build example example/tx test
From: vicente.botet_at_[hidden]
Date: 2010-01-06 17:03:27


Author: viboes
Date: 2010-01-06 17:03:25 EST (Wed, 06 Jan 2010)
New Revision: 58781
URL: http://svn.boost.org/trac/boost/changeset/58781

Log:
TBoost.STM vbe: Make macros BOOST_STM_BREAK and BOOST_STM_CONTINUE work

Text files modified:
   sandbox/stm/branches/vbe/libs/stm/build/Jamfile.v2 | 14 +++++---------
   sandbox/stm/branches/vbe/libs/stm/example/counter.cpp | 10 +++-------
   sandbox/stm/branches/vbe/libs/stm/example/tx/list.cpp | 3 ---
   sandbox/stm/branches/vbe/libs/stm/example/tx/numeric.cpp | 13 ++++++++-----
   sandbox/stm/branches/vbe/libs/stm/test/Jamfile.v2 | 2 +-
   5 files changed, 17 insertions(+), 25 deletions(-)

Modified: sandbox/stm/branches/vbe/libs/stm/build/Jamfile.v2
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/build/Jamfile.v2 (original)
+++ sandbox/stm/branches/vbe/libs/stm/build/Jamfile.v2 2010-01-06 17:03:25 EST (Wed, 06 Jan 2010)
@@ -41,16 +41,12 @@
     : source-location ../src
     : requirements
         <threading>multi
-# <target-os>cygwin
- #<interthreadapi>pthread
-# <variant>debug
-# <define>BOOST_THREAD_HAS_THREAD_ATTR
-
- <include>../../..
+# <define>BOOST_THREAD_HAS_THREAD_ATTR
+ #<include>../../..
       #<include>$BOOST_ROOT
- <include>/boost_1_39_0
- <link>static:<define>BOOST_INTERTHREADS_BUILD_LIB=1
- <link>shared:<define>BOOST_INTERTHREADS_BUILD_DLL=1
+ #<include>/boost_1_39_0
+ <link>static:<define>BOOST_STM_BUILD_LIB=1
+ <link>shared:<define>BOOST_STM_BUILD_DLL=1
 # <link>shared:<library>/boost/thread//boost_thread/<link>shared
 # -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
 # <tag>@$(__name__).tag

Modified: sandbox/stm/branches/vbe/libs/stm/example/counter.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/example/counter.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/example/counter.cpp 2010-01-06 17:03:25 EST (Wed, 06 Jan 2010)
@@ -40,11 +40,9 @@
 }
 bool check(int val) {
     //thread_initializer thi;
- bool res;
     BOOST_STM_ATOMIC(_) {
- res =(*counter==val);
+ BOOST_STM_TX_RETURN(_, *counter==val);
     } BOOST_STM_END_ATOMIC
- return res;
 }
 
 bool assign() {
@@ -55,7 +53,7 @@
     } BOOST_STM_END_ATOMIC
     bool res;
     BOOST_STM_ATOMIC(_) {
- res =(*counter==1) && (*counter2==1) && (counter==counter2) ;
+ BOOST_STM_TX_RETURN(_, (*counter==1) && (*counter2==1) && (counter==counter2)) ;
     } BOOST_STM_END_ATOMIC
     return res;
 }
@@ -65,11 +63,9 @@
     BOOST_STM_ATOMIC(_) {
         counter2=c;
     } BOOST_STM_END_ATOMIC
- bool res;
     BOOST_STM_ATOMIC(_) {
- res =(c==counter2) ;
+ BOOST_STM_TX_RETURN(_, c==counter2) ;
     } BOOST_STM_END_ATOMIC
- return res;
 }
 
 int test_counter() {

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-01-06 17:03:25 EST (Wed, 06 Jan 2010)
@@ -274,9 +274,6 @@
     fails= fails || !check_lookup(1);
     fails= fails || check_lookup(2);
     fails= fails || !check_size(2);
- #if 0
- SLEEP(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-01-06 17:03:25 EST (Wed, 06 Jan 2010)
@@ -73,12 +73,14 @@
 
 bool test_assign() {
     //thread_initializer thi;
- BOOST_STM_ATOMIC(_) {
+ for(int i=0; i<2;++i)
+ BOOST_STM_ATOMIC_IN_LOOP(_) {
         counter=1;
         counter2=counter;
- BOOST_STM_CONTINUE;
+ BOOST_STM_CONTINUE(_);
         counter2=3;
     } BOOST_STM_END_ATOMIC
+
     BOOST_STM_ATOMIC(_) {
         //assert((counter==1) && (counter2==1) && (counter==counter2));
         BOOST_STM_TX_RETURN(_, (counter==1) && (counter2==1) && (counter==counter2)) ;
@@ -88,11 +90,12 @@
 
 bool test_less() {
     //thread_initializer thi;
- BOOST_STM_ATOMIC(_) {
+ for(;;)
+ BOOST_STM_ATOMIC_IN_LOOP(_) {
         counter=1;
         counter2=2;
- BOOST_STM_BREAK;
- counter2=3;
+ BOOST_STM_BREAK(_);
+ counter2=0;
     } BOOST_STM_END_ATOMIC
     BOOST_STM_ATOMIC(_) {
         //assert(counter<counter2);

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-01-06 17:03:25 EST (Wed, 06 Jan 2010)
@@ -23,7 +23,7 @@
         <include>.
         <include>../../..
         #<include>$BOOST_ROOT
- <include>/boost_1_39_0
+ #<include>/boost_1_39_0
         <threading>multi
 # <target-os>cygwin
 # <interthreadapi>pthread


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