Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59957 - in sandbox/stm/branches/vbe/boost/stm: . detail latm
From: vicente.botet_at_[hidden]
Date: 2010-02-27 04:29:06


Author: viboes
Date: 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
New Revision: 59957
URL: http://svn.boost.org/trac/boost/changeset/59957

Log:
Boost.STM/vbe:
* Change default behavior for exception leaving the transaction block to commit the transaction and throw, instead of aborting the transaction and throw on the new macros.
* replace the use of accessors field()=x;
* Add assertions instead of throwing when this is due to crash
Text files modified:
   sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tx_impl.hpp | 2
   sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tx_impl.hpp | 2
   sandbox/stm/branches/vbe/boost/stm/detail/transaction_impl.hpp | 107 +++++++++++++++++++++------------------
   sandbox/stm/branches/vbe/boost/stm/language_like.hpp | 33 ++++++++++-
   sandbox/stm/branches/vbe/boost/stm/latm/all_in_one_mode.hpp | 2
   sandbox/stm/branches/vbe/boost/stm/latm/base_mode.hpp | 2
   sandbox/stm/branches/vbe/boost/stm/transaction.hpp | 58 ++++++++++----------
   7 files changed, 118 insertions(+), 88 deletions(-)

Modified: sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tx_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tx_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tx_impl.hpp 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
@@ -107,7 +107,7 @@
             {
                 if (0 == thread_id_occurance_in_locked_locks_map(*it))
                 {
- blocked(*it) = false;
+ *blocked_ptr(*it) = false;
                 }
             }
             throw;

Modified: sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tx_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tx_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tx_impl.hpp 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
@@ -107,7 +107,7 @@
             {
                 if (0 == thread_id_occurance_in_locked_locks_map(*it))
                 {
- blocked(*it) = false;
+ *blocked_ptr(*it) = false;
                 }
             }
             throw;

Modified: sandbox/stm/branches/vbe/boost/stm/detail/transaction_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/transaction_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/transaction_impl.hpp 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
@@ -44,24 +44,24 @@
 //--------------------------------------------------------------------------
 inline bool transaction::isolatedTxInFlight()
 {
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     assert_tx_type();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    for (InflightTxes::iterator i = transactionsInFlight_.begin();
       i != transactionsInFlight_.end(); ++i)
    {
         BOOST_ASSERT(*i!=0);
         (*i)->assert_tx_type();
 
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
       // if this is our threadId, skip it
       if ((*i)->threadId_ == this->threadId_) continue;
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 
       if ((*i)->isolated()) return true;
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    }
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 
    return false;
 }
@@ -197,12 +197,14 @@
 //--------------------------------------------------------------------------
 inline bool transaction::irrevocable() const
 {
+ BOOST_STM_INFO << "tx_type="<<tx_type()<<"@"<<const_cast<transaction*>(this)->tx_type_ptr()<<std::endl;
    switch (tx_type())
    {
    case eNormalTx: return false;
    case eIrrevocableTx: return true;
    case eIrrevocableAndIsolatedTx: return true;
    default:
+ BOOST_STM_ERROR << "tx_type="<<tx_type()<<"@"<<const_cast<transaction*>(this)->tx_type_ptr()<<std::endl;
         BOOST_ASSERT(false&&"tx type not found");
         return false;
    }
@@ -212,12 +214,14 @@
 //--------------------------------------------------------------------------
 inline bool transaction::isolated() const
 {
+ BOOST_STM_INFO << "tx_type="<<tx_type()<<"@"<< const_cast<transaction*>(this)->tx_type_ptr()<<std::endl;
    switch (tx_type())
    {
    case eNormalTx: return false;
    case eIrrevocableTx: return false;
    case eIrrevocableAndIsolatedTx: return true;
    default:
+ BOOST_STM_ERROR << "tx_type="<<tx_type()<<"@"<<const_cast<transaction*>(this)->tx_type_ptr()<<std::endl;
         BOOST_ASSERT(false&&"tx type not found");
         return false;
    }
@@ -225,13 +229,14 @@
 
 inline void transaction::assert_tx_type() const
 {
+ BOOST_STM_INFO << "tx_type="<<tx_type()<<"@"<<const_cast<transaction*>(this)->tx_type_ptr()<<std::endl;
    switch (tx_type())
    {
    case eNormalTx: return ;
    case eIrrevocableTx: return ;
    case eIrrevocableAndIsolatedTx: return ;
    default:
- BOOST_STM_ERROR;
+ BOOST_STM_ERROR << "tx_type="<<tx_type()<<"@"<<const_cast<transaction*>(this)->tx_type_ptr()<<std::endl;
    }
 }
 
@@ -461,7 +466,7 @@
    mutexRef_(threadMutexes_.find(threadId_)->second),
 
 #if PERFORMING_LATM
- blockedRef_(blocked(threadId_)),
+ blockedRef_(*blocked_ptr(threadId_)),
 #endif
 
 #if PERFORMING_LATM
@@ -500,7 +505,7 @@
    mutexRef_(threadMutexes_.find(threadId_)->second),
 
 #if PERFORMING_LATM
- blockedRef_(blocked(threadId_)),
+ blockedRef_(*blocked_ptr(threadId_)),
 #endif
 
 #if PERFORMING_LATM
@@ -562,7 +567,7 @@
       // list, then allow the thread to make forward progress again
       // by turning its "blocked" but only if it does not appear in the
       // locked_locks_thread_id_map
- o << iter->first << " blocked: " << blocked(iter->first) << endl;
+ o << iter->first << " blocked: " << *blocked_ptr(iter->first) << endl;
       o << "\t";
 
       for (latm::mutex_set::iterator inner = iter->second->begin(); inner != iter->second->end(); ++inner)
@@ -594,19 +599,19 @@
 //--------------------------------------------------------------------------
 inline bool transaction::restart()
 {
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     assert_tx_type();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    if (e_in_flight == state_) lock_and_abort();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 
 #if PERFORMING_LATM
 #ifdef LOGGING_BLOCKS
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    int iterations = 0;
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 #endif
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    while (blocked())
    {
 #ifdef LOGGING_BLOCKS
@@ -623,7 +628,7 @@
       SLEEP(10);
    }
 #endif
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    //-----------------------------------------------------------------------
    // this is a vital check for composed transactions that abort, but the
    // outer instance tx is never destructed, but instead restarted via
@@ -633,26 +638,26 @@
 #ifdef USING_SHARED_FORCED_TO_ABORT
    {
    synchro::lock_guard<Mutex> lock_i(*inflight_lock());
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    if (!otherInFlightTransactionsOfSameThreadNotIncludingThis(this))
    {
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
       unforce_to_abort();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    }
    }
 #else
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    unforce_to_abort();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 #endif
 #endif
 
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     assert_tx_type();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    put_tx_inflight();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 
 #if 0
    if (doing_dynamic_priority_assignment())
@@ -663,7 +668,7 @@
    reads_ = 0;
 #endif
 
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    return true;
 }
 
@@ -715,71 +720,71 @@
 //--------------------------------------------------------------------------
 inline void transaction::put_tx_inflight()
 {
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     assert_tx_type();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 #if PERFORMING_LATM
    while (true)
    {
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
       {
       synchro::lock_guard<Mutex> lock_i(*inflight_lock());
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 
           bool b1=latm::instance().can_go_inflight();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
           bool b2=!isolatedTxInFlight();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
       if (b1 && b2)
       {
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
          transactionsInFlight_.insert(this);
          state_ = e_in_flight;
          break;
       }
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 
       }
       SLEEP(10);
    }
 #else
    synchro::lock_guard<Mutex> lock_i(*inflight_lock());
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    transactionsInFlight_.insert(this);
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
    state_ = e_in_flight;
 #endif
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     assert_tx_type();
- //~ BOOST_STM_INFO;
+ //~ BOOST_STM_INFO<<std::endl;
 }
 
 //--------------------------------------------------------------------------
 //--------------------------------------------------------------------------
 inline transaction::~transaction()
 {
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     assert_tx_type();
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
    // if we're not an inflight transaction - bail
    if (state_ != e_in_flight)
    {
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
       //if (hasLock()) unlock_tx();
       return;
    }
 
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     //if (!hasLock())
     {
        synchro::lock_guard<Mutex> lock(*mutex());
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
         abort();
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     }
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
     transactions().pop();
- BOOST_STM_INFO;
+ BOOST_STM_INFO<<std::endl;
 
     // BUG not removed from the list because the test is inversed
     //~ if (alreadyRemovedFromInFlight)
@@ -926,7 +931,7 @@
          synchro::unlock(*general_lock());
          synchro::unlock(*inflight_lock());
       } else {
- BOOST_STM_ERROR;
+ BOOST_STM_ERROR<<std::endl;
           std::cout << "invalidating_direct_end_transaction e_committed != state_" << std::endl;
       }
    }
@@ -1384,7 +1389,7 @@
    }
    catch (...)
    {
- BOOST_STM_ERROR;
+ BOOST_STM_ERROR<<std::endl;
       std::cout << "Exception caught in abort - bad" << std::endl;
    }
 }
@@ -1715,7 +1720,8 @@
       bookkeeping_.inc_new_mem_commits_by(newMemoryList().size());
       directCommitTransactionNewMemory();
 
- tx_type_ref() = eNormalTx;
+ //~ tx_type_ptr() = eNormalTx;
+ tx_type(eNormalTx);
 #if PERFORMING_LATM
       get_tx_conflicting_locks().clear();
       /* BACKTRACE
@@ -1835,7 +1841,8 @@
 
       // finally set the state to committed
       bookkeeping_.inc_commits();
- tx_type_ref() = eNormalTx;
+ //~ tx_type_ptr() = eNormalTx;
+ tx_type(eNormalTx);
 #if PERFORMING_LATM
       get_tx_conflicting_locks().clear();
       clear_latm_obtained_locks();

Modified: sandbox/stm/branches/vbe/boost/stm/language_like.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/language_like.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/language_like.hpp 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
@@ -250,10 +250,19 @@
                     __boost_stm_ctrl_=boost::stm::detail::none; \
                     break; \
                 } while ((__boost_stm_ctrl_=boost::stm::detail::continue_),false); \
- } catch(...) { \
- if (false)std::cout << __FILE__ << "["<<__LINE__<<"] catch1" << std::endl;\
+ } catch (boost::stm::aborted_tx &) { \
                 __boost_stm_destr_.release(); \
                 throw; \
+ } catch(...) { \
+ std::cout << __FILE__ << "["<<__LINE__<<"] catch1" << std::endl;\
+ if (__boost_stm_txn_.forced_to_abort()) {\
+ std::cout << __FILE__ << "["<<__LINE__<<"] catch11" << std::endl;\
+ __boost_stm_destr_.release(); \
+ } else {\
+ __boost_stm_destr_.commit();\
+ }\
+ std::cout << __FILE__ << "["<<__LINE__<<"] catch12" << std::endl;\
+ throw; \
             } \
             break; \
         } catch (boost::stm::aborted_tx &) { \
@@ -403,7 +412,7 @@
 //---------------------------------------------------------------------------
 // aborts the transaction TX
 //---------------------------------------------------------------------------
-#define BOOST_STM_TX_ABORT(TX) (TX).force_to_abort()
+#define BOOST_STM_TX_ABORT(TX) (TX).abort()
 
 //---------------------------------------------------------------------------
 // aborts the current transaction
@@ -412,18 +421,28 @@
     if (boost::stm::current_transaction()==0) ; \
     else BOOST_STM_TX_ABORT(*boost::stm::current_transaction())
 
+#define BOOST_STM_E_ABORT BOOST_STM_CURRENT.abort()
+
 //---------------------------------------------------------------------------
 // aborts the transaction TX
 //---------------------------------------------------------------------------
-#define BOOST_STM_TX_ABORT_OUTER(TX) (TX).force_to_abort()
+#define BOOST_STM_TX_ABORT_OUTER(TX) (TX).abort()
 
 //---------------------------------------------------------------------------
 // aborts the current transaction
 //---------------------------------------------------------------------------
+#define BOOST_STM_E_ABORT_OUTER(TX) BOOST_STM_TX_ABORT_OUTER(BOOST_STM_CURRENT)
+
 #define BOOST_STM_ABORT_OUTER \
     if (boost::stm::current_transaction()==0) ; \
     else BOOST_STM_TX_ABORT_OUTER(*boost::stm::current_transaction())
 
+//---------------------------------------------------------------------------
+// commits the current transaction
+//---------------------------------------------------------------------------
+#define BOOST_STM_TX_COMMIT(TX) (TX).commit()
+
+#define BOOST_STM_E_COMMIT BOOST_STM_TX_COMMIT(BOOST_STM_CURRENT)
 
 //---------------------------------------------------------------------------
 // throw an exception
@@ -435,7 +454,9 @@
 //---------------------------------------------------------------------------
 // aborts the transaction TX and throw exception
 //---------------------------------------------------------------------------
-#define BOOST_STM_TX_ABORT_AND_THROW(TX, EXCEPTION) if ((TX).force_to_abort()) throw (EXCEPTION)
+#define BOOST_STM_TX_ABORT_AND_THROW(TX, EXCEPTION) if ((TX).force_to_abort(),false) ; throw (EXCEPTION)
+#define BOOST_STM_E_ABORT_AND_THROW(EXCEPTION) BOOST_STM_TX_ABORT_AND_THROW(BOOST_STM_CURRENT, EXCEPTION)
+
 
 //---------------------------------------------------------------------------
 // aborts the current transaction
@@ -456,6 +477,8 @@
     if (boost::stm::current_transaction()==0) ; \
     else BOOST_STM_TX_ABORT_OUTER_AND_THROW(*boost::stm::current_transaction(), EXCEPTION)
 
+
+
 //---------------------------------------------------------------------------
 // Memory management
 //---------------------------------------------------------------------------

Modified: sandbox/stm/branches/vbe/boost/stm/latm/all_in_one_mode.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/latm/all_in_one_mode.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/latm/all_in_one_mode.hpp 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
@@ -38,7 +38,7 @@
         case eTxConflictingLockLatmProtection:
             return "tx_protect";
         default:
- throw "invalid LATM type";
+ BOOST_ASSERT(false&& "invalid LATM type");
         }
     }
     void do_full_lock_protection_i() {

Modified: sandbox/stm/branches/vbe/boost/stm/latm/base_mode.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/latm/base_mode.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/latm/base_mode.hpp 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
@@ -44,7 +44,7 @@
     {
        if (tmConflictingLocks_.find(inLock) == tmConflictingLocks_.end())
        {
- throw "lock not in tx conflict lock set, use add_tm_conflicting_lock";
+ invalid_operation(false&& "lock not in tx conflict lock set, use add_tm_conflicting_lock");
        }
     }
 

Modified: sandbox/stm/branches/vbe/boost/stm/transaction.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/transaction.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/transaction.hpp 2010-02-27 04:29:03 EST (Sat, 27 Feb 2010)
@@ -859,7 +859,7 @@
       // can't abort irrevocable transactions
       if (irrevocable()) return;
 
- forced_to_abort_ref() = true;
+ *forced_to_abort_ptr() = true;
 
 #ifdef PERFORMING_COMPOSITION
 #ifndef USING_SHARED_FORCED_TO_ABORT
@@ -873,12 +873,12 @@
          transaction *t = *j;
 
          // if this is a parent or child tx, it must abort too
- if (t->threadId_ == this->threadId_) t->forced_to_abort_ref() = true;
+ if (t->threadId_ == this->threadId_) *(t->forced_to_abort_ptr()) = true;
       }
 #endif
 #endif
    }
- inline void unforce_to_abort() { forced_to_abort_ref() = false; }
+ inline void unforce_to_abort() { *forced_to_abort_ptr() = false; }
 
    //--------------------------------------------------------------------------
    void lock_and_abort();
@@ -1195,14 +1195,14 @@
    template <typename T>
    static typename boost::enable_if<is_base_of<base_transaction_object, T>, void>::type
    set_thread(T & in, thread_id_t thread_id, detail::dummy<0> = 0) {
- in.transaction_thread() = thread_id;
+ in.transaction_thread(thread_id);
    }
 
    template <typename T>
    typename boost::disable_if<is_base_of<base_transaction_object, T>, void>::type
    static set_thread(T & in, thread_id_t thread_id, detail::dummy<1> = 0) {
        // not yet implemented
- in.transaction_thread() = thread_id;
+ in.transaction_thread(thread_id);
    }
 
    //--------------------------------------------------------------------------
@@ -1230,7 +1230,7 @@
 
         bool all_invalid = true;
         for (int i=size-1; i>=0; --i) {
- if (in[i].transaction_thread() = invalid_thread_id()) {
+ if (in[i].transaction_thread() == invalid_thread_id()) {
                 all_invalid=false;
                 break;
             }
@@ -1855,7 +1855,7 @@
     TxType *txTypeRef_;
     inline TxType const tx_type() const { return *txTypeRef_; }
     inline void tx_type(TxType const &rhs) { *txTypeRef_ = rhs; }
- inline TxType& tx_type_ref() { return *txTypeRef_; }
+ inline TxType* tx_type_ptr() { return txTypeRef_; }
 #else // BOOST_STM_TX_CONTAINS_REFERENCES_TO_TSS_FIELDS
     inline WriteContainer *write_list() {
         return &context_.writeMem;
@@ -1873,7 +1873,7 @@
     inline MemoryContainerList& deletedMemoryList() { return context_.delMem; }
     inline TxType const tx_type() const { return context_.txType; }
     inline void tx_type(TxType const &rhs) { context_.txType = rhs; }
- inline TxType& tx_type_ref() { return context_.txType; }
+ inline TxType* tx_type_ptr() { return &context_.txType; }
 #endif
 
 #ifdef USING_SHARED_FORCED_TO_ABORT
@@ -1882,19 +1882,19 @@
 public:
     inline int const forced_to_abort() const { return *forcedToAbortRef_; }
 private:
- inline int& forced_to_abort_ref() { return *forcedToAbortRef_; }
+ inline int* forced_to_abort_ptr() { return forcedToAbortRef_; }
 #else
 public:
     inline int const forced_to_abort() const { return context_.abort; }
 private:
- inline int& forced_to_abort_ref() { return context_.abort; }
+ inline int* forced_to_abort_ptr() { return &context_.abort; }
 #endif
 #else
    int forcedToAbortRef_;
 public:
     inline int const forced_to_abort() const { return forcedToAbortRef_; }
 private:
- inline int& forced_to_abort_ref() { return forcedToAbortRef_; }
+ inline int* forced_to_abort_ptr() { return &forcedToAbortRef_; }
 #endif
 
     static ThreadMutexContainer threadMutexes_;
@@ -1911,7 +1911,7 @@
    inline void block() { blockedRef_ = true; }
    inline void unblock() { blockedRef_ = false; }
    inline int const blocked() const { return blockedRef_; }
- inline static int& blocked(thread_id_t id) { return *threadBlockedLists_.find(id)->second; }
+ inline static int* blocked_ptr(thread_id_t id) { return threadBlockedLists_.find(id)->second; }
 #endif
 
 
@@ -1930,7 +1930,7 @@
         for (latm::thread_id_mutex_set_map::iterator iter = threadConflictingMutexes_.begin();
             threadConflictingMutexes_.end() != iter; ++iter)
         {
- blocked(iter->first) = b;
+ *blocked_ptr(iter->first) = b;
         }
     }
 
@@ -1945,7 +1945,7 @@
             if (iter->second->find(mutex) != iter->second->end() &&
                 0 == thread_id_occurance_in_locked_locks_map(iter->first))
             {
- blocked(iter->first) = false;
+ *blocked_ptr(iter->first) = false;
             }
         }
    }
@@ -2020,7 +2020,7 @@
     TxType *txTypeRef_;
     inline TxType const tx_type() const { return *txTypeRef_; }
     inline void tx_type(TxType const &rhs) { *txTypeRef_ = rhs; }
- inline TxType& tx_type_ref() { return *txTypeRef_; }
+ inline TxType* tx_type_ptr() { return txTypeRef_; }
 #else // BOOST_STM_TX_CONTAINS_REFERENCES_TO_TSS_FIELDS
     inline WriteContainer *write_list() {
         return &context_.tx_.writeMem;
@@ -2038,7 +2038,7 @@
    inline MemoryContainerList& deletedMemoryList() { return context_.tx_.delMem; }
    inline TxType const tx_type() const { return context_.tx_.txType; }
    inline void tx_type(TxType const &rhs) { context_.tx_.txType = rhs; }
- inline TxType& tx_type_ref() { return context_.tx_.txType; }
+ inline TxType* tx_type_ptr() { return &context_.tx_.txType; }
 #endif
 
 #ifdef USING_SHARED_FORCED_TO_ABORT
@@ -2047,19 +2047,19 @@
 public:
     inline int const forced_to_abort() const { return *forcedToAbortRef_; }
 private:
- inline int& forced_to_abort_ref() { return *forcedToAbortRef_; }
+ inline int* forced_to_abort_ptr() { return forcedToAbortRef_; }
 #else
 public:
     inline int const forced_to_abort() const { return context_.tx_.abort; }
 private:
- inline int& forced_to_abort_ref() { return context_.tx_.abort; }
+ inline int* forced_to_abort_ptr() { return &context_.tx_.abort; }
 #endif
 #else
    int forcedToAbortRef_;
 public:
     inline int const forced_to_abort() const { return forcedToAbortRef_; }
 private:
- inline int& forced_to_abort_ref() { return forcedToAbortRef_; }
+ inline int* forced_to_abort_ptr() { return &forcedToAbortRef_; }
 #endif
 
     inline Mutex * mutex() { return &context_.mutex_; }
@@ -2072,9 +2072,9 @@
    inline void block() { context_.blocked_ = true; }
    inline void unblock() { context_.blocked_ = false; }
    inline int const blocked() const { return context_.blocked_; }
- inline static int& blocked(thread_id_t id) {
+ inline static int* blocked_ptr(thread_id_t id) {
         tss_context_map_type::iterator i = tss_context_map_.find(id);
- return i->second->blocked_;
+ return &i->second->blocked_;
     }
 #endif
 
@@ -2091,7 +2091,7 @@
         for (tss_context_map_type::iterator iter = tss_context_map_.begin();
             tss_context_map_.end() != iter; ++iter)
         {
- blocked(iter->first) = b;
+ *blocked_ptr(iter->first) = b;
         }
     }
 
@@ -2106,7 +2106,7 @@
             if (iter->second->conflictingMutex_.find(mutex) != iter->second->conflictingMutex_.end() &&
                 0 == thread_id_occurance_in_locked_locks_map(iter->first))
             {
- blocked(iter->first) = false;
+ *blocked_ptr(iter->first) = false;
             }
         }
    }
@@ -2187,20 +2187,20 @@
    TxType *txTypeRef_;
    inline TxType const tx_type() const { return *txTypeRef_; }
    inline void tx_type(TxType const &rhs) { *txTypeRef_ = rhs; }
- inline TxType& tx_type_ref() { return *txTypeRef_; }
+ inline TxType* tx_type_ptr() { return txTypeRef_; }
 
 #ifdef USING_SHARED_FORCED_TO_ABORT
    int *forcedToAbortRef_;
 public:
     inline int const forced_to_abort() const { return *forcedToAbortRef_; }
 private:
- inline int& forced_to_abort_ref() { return *forcedToAbortRef_; }
+ inline int* forced_to_abort_ptr() { return forcedToAbortRef_; }
 #else
    int forcedToAbortRef_;
 public:
     inline int const forced_to_abort() const { return forcedToAbortRef_; }
 private:
- inline int& forced_to_abort_ref() { return forcedToAbortRef_; }
+ inline int* forced_to_abort_ptr() { return &forcedToAbortRef_; }
 #endif
 
     static ThreadMutexContainer threadMutexes_;
@@ -2217,7 +2217,7 @@
    inline void block() { blockedRef_ = true; }
    inline void unblock() { blockedRef_ = false; }
    inline int const blocked() const { return blockedRef_; }
- inline static int& blocked(thread_id_t id) { return *threadBlockedLists_.find(id)->second; }
+ inline static int* blocked_ptr(thread_id_t id) { return threadBlockedLists_.find(id)->second; }
 #endif
 
 
@@ -2236,7 +2236,7 @@
         for (latm::thread_id_mutex_set_map::iterator iter = threadConflictingMutexes_.begin();
             threadConflictingMutexes_.end() != iter; ++iter)
         {
- blocked(iter->first) = b;
+ *blocked_ptr(iter->first) = b;
         }
     }
 
@@ -2251,7 +2251,7 @@
             if (iter->second->find(mutex) != iter->second->end() &&
                 0 == thread_id_occurance_in_locked_locks_map(iter->first))
             {
- blocked(iter->first) = false;
+ *blocked_ptr(iter->first) = 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