|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57031 - sandbox/stm/branches/vbe/libs/stm/example
From: vicente.botet_at_[hidden]
Date: 2009-10-21 03:59:50
Author: viboes
Date: 2009-10-21 03:59:49 EDT (Wed, 21 Oct 2009)
New Revision: 57031
URL: http://svn.boost.org/trac/boost/changeset/57031
Log:
TBoost.STM vbe: Fix counter example test
Text files modified:
sandbox/stm/branches/vbe/libs/stm/example/counter.cpp | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
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 2009-10-21 03:59:49 EDT (Wed, 21 Oct 2009)
@@ -27,48 +27,48 @@
void inc() {
thread_initializer thi;
- use_atomic(_) {
+ atomic(_) {
++counter;
- }
+ } end_atom
}
void decr() {
thread_initializer thi;
- use_atomic(_) {
+ atomic(_) {
--counter;
- }
+ } end_atom
}
bool check(int val) {
//thread_initializer thi;
bool res;
- use_atomic(_) {
+ atomic(_) {
res =(*counter==val);
- }
+ } end_atom
return res;
}
bool assign() {
//thread_initializer thi;
- use_atomic(_) {
+ atomic(_) {
counter=1;
counter2=counter;
- }
+ } end_atom
bool res;
- use_atomic(_) {
+ atomic(_) {
res =(*counter==1) && (*counter2==1) && (counter==counter2) ;
- }
+ } end_atom
return res;
}
bool test_const(stm::tx_obj<int> const& c) {
//thread_initializer thi;
- use_atomic(_) {
+ atomic(_) {
counter2=c;
- }
+ } end_atom
bool res;
- use_atomic(_) {
+ atomic(_) {
res =(c==counter2) ;
- }
+ } end_atom
return res;
}
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