Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57154 - in sandbox/stm/branches/vbe: boost boost/stm boost/stm/detail boost/stm/latm libs/stm/src libs/stm/test
From: vicente.botet_at_[hidden]
Date: 2009-10-25 12:29:18


Author: viboes
Date: 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
New Revision: 57154
URL: http://svn.boost.org/trac/boost/changeset/57154

Log:
TBoost.STM vbe: Start moving LATM specificities to latm directory and namespace

Added:
   sandbox/stm/branches/vbe/boost/stm/latm/
   sandbox/stm/branches/vbe/boost/stm/latm.hpp (contents, props changed)
   sandbox/stm/branches/vbe/boost/stm/latm/base_mode.hpp (contents, props changed)
   sandbox/stm/branches/vbe/boost/stm/latm/datatypes.hpp (contents, props changed)
   sandbox/stm/branches/vbe/boost/stm/latm/dynamic.hpp (contents, props changed)
   sandbox/stm/branches/vbe/boost/stm/latm/full.hpp (contents, props changed)
   sandbox/stm/branches/vbe/boost/stm/latm/selector.hpp (contents, props changed)
Text files modified:
   sandbox/stm/branches/vbe/boost/stm.hpp | 2
   sandbox/stm/branches/vbe/boost/stm/detail/latm_def_full_impl.hpp | 8
   sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tm_impl.hpp | 8
   sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tx_impl.hpp | 10
   sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_full_impl.hpp | 8
   sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tm_impl.hpp | 8
   sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tx_impl.hpp | 10
   sandbox/stm/branches/vbe/boost/stm/detail/latm_general_impl.hpp | 119 +++++-----------------
   sandbox/stm/branches/vbe/boost/stm/detail/transaction_impl.hpp | 16 +-
   sandbox/stm/branches/vbe/boost/stm/transaction.hpp | 211 ++++++++++++++++++---------------------
   sandbox/stm/branches/vbe/libs/stm/src/transaction.cpp | 51 ++++----
   sandbox/stm/branches/vbe/libs/stm/test/isolatedIntLockInTx.cpp | 2
   sandbox/stm/branches/vbe/libs/stm/test/litExample.cpp | 6
   sandbox/stm/branches/vbe/libs/stm/test/lotExample.cpp | 6
   sandbox/stm/branches/vbe/libs/stm/test/nestedTxs.cpp | 4
   sandbox/stm/branches/vbe/libs/stm/test/stm.cpp | 6
   sandbox/stm/branches/vbe/libs/stm/test/testHT_latm.cpp | 2
   sandbox/stm/branches/vbe/libs/stm/test/testHashMapAndLinkedListsWithLocks.cpp | 4
   sandbox/stm/branches/vbe/libs/stm/test/testHashMapWithLocks.cpp | 4
   sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.cpp | 2
   sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.h | 6
   sandbox/stm/branches/vbe/libs/stm/test/testLinkedListWithLocks.h | 4
   sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.cpp | 2
   sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.h | 4
   24 files changed, 210 insertions(+), 293 deletions(-)

Modified: sandbox/stm/branches/vbe/boost/stm.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -33,6 +33,6 @@
 #include <boost/stm/txw.hpp>
 
 ///////////////////////////////////////////////////////////////////////////////
-#endif // TRANSACTION_H
+#endif // BOOST_STM__HPP
 
 

Modified: sandbox/stm/branches/vbe/boost/stm/detail/latm_def_full_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/latm_def_full_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/latm_def_full_impl.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -50,7 +50,7 @@
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 inline bool transaction::def_do_core_full_pthread_lock_mutex
-(latm_mutex mutex, int lockWaitTime, int lockAborted)
+(latm::mutex_type* mutex, int lockWaitTime, int lockAborted)
 {
    //--------------------------------------------------------------------------
    // if the lock-aware tm lock set is empty, lock the in-flight trans mutex
@@ -104,7 +104,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_full_pthread_lock_mutex(latm_mutex mutex)
+inline int transaction::def_full_pthread_lock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -172,7 +172,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_full_pthread_trylock_mutex(latm_mutex mutex)
+inline int transaction::def_full_pthread_trylock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -229,7 +229,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_full_pthread_unlock_mutex(latm_mutex mutex)
+inline int transaction::def_full_pthread_unlock_mutex(latm::mutex_type* mutex)
 {
    bool hasLock = true;
    { synchro::lock_guard<Mutex> lock_l(latmMutex_);

Modified: sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tm_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tm_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/latm_def_tm_impl.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -50,7 +50,7 @@
 //
 //----------------------------------------------------------------------------
 inline bool transaction::def_do_core_tm_conflicting_lock_pthread_lock_mutex
-(latm_mutex mutex, int lockWaitTime, int lockAborted)
+(latm::mutex_type* mutex, int lockWaitTime, int lockAborted)
 {
    //--------------------------------------------------------------------------
    // if this mutex is on the tmConflictingLocks_ set, then we need to stop
@@ -97,7 +97,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_tm_conflicting_lock_pthread_lock_mutex(latm_mutex mutex)
+inline int transaction::def_tm_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -170,7 +170,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_tm_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex)
+inline int transaction::def_tm_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -231,7 +231,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_tm_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex)
+inline int transaction::def_tm_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex)
 {
    bool hasLock = true;
    {

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 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -42,7 +42,7 @@
 //
 //----------------------------------------------------------------------------
 inline bool transaction::def_do_core_tx_conflicting_lock_pthread_lock_mutex
-(latm_mutex mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable)
+(latm::mutex_type* mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable)
 {
    //--------------------------------------------------------------------------
    // see if this mutex is part of any of the in-flight transactions conflicting
@@ -94,7 +94,7 @@
 
       try {
          latmLockedLocksAndThreadIdsMap_.insert
- (std::make_pair<latm_mutex, ThreadIdSet>(mutex, txThreadId));
+ (std::make_pair<latm::mutex_type*, ThreadIdSet>(mutex, txThreadId));
       }
       catch (...)
       {
@@ -121,7 +121,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_tx_conflicting_lock_pthread_lock_mutex(latm_mutex mutex)
+inline int transaction::def_tx_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex)
 {
    int waitTime = 0, aborted = 0;
 
@@ -211,7 +211,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_tx_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex)
+inline int transaction::def_tx_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex)
 {
    //--------------------------------------------------------------------------
 
@@ -264,7 +264,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::def_tx_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex)
+inline int transaction::def_tx_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex)
 {
    synchro::lock_guard<Mutex> autolock_l(*latm_lock());
    synchro::lock_guard<Mutex> autolock_g(*general_lock());

Modified: sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_full_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_full_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_full_impl.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -50,7 +50,7 @@
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 inline bool transaction::dir_do_core_full_pthread_lock_mutex
-(latm_mutex mutex, int lockWaitTime, int lockAborted)
+(latm::mutex_type* mutex, int lockWaitTime, int lockAborted)
 {
    //--------------------------------------------------------------------------
    // if the lock-aware tm lock set is empty, lock the in-flight trans mutex
@@ -121,7 +121,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_full_pthread_lock_mutex(latm_mutex mutex)
+inline int transaction::dir_full_pthread_lock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -187,7 +187,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_full_pthread_trylock_mutex(latm_mutex mutex)
+inline int transaction::dir_full_pthread_trylock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -244,7 +244,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_full_pthread_unlock_mutex(latm_mutex mutex)
+inline int transaction::dir_full_pthread_unlock_mutex(latm::mutex_type* mutex)
 {
    bool hasLock = true;
     {

Modified: sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tm_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tm_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/latm_dir_tm_impl.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -50,7 +50,7 @@
 //
 //----------------------------------------------------------------------------
 inline bool transaction::dir_do_core_tm_conflicting_lock_pthread_lock_mutex
-(latm_mutex mutex, int lockWaitTime, int lockAborted)
+(latm::mutex_type* mutex, int lockWaitTime, int lockAborted)
 {
    //--------------------------------------------------------------------------
    // if this mutex is on the tmConflictingLocks_ set, then we need to stop
@@ -117,7 +117,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_tm_conflicting_lock_pthread_lock_mutex(latm_mutex mutex)
+inline int transaction::dir_tm_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -175,7 +175,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_tm_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex)
+inline int transaction::dir_tm_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex)
 {
    if (transaction* t = get_inflight_tx_of_same_thread(false))
    {
@@ -222,7 +222,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_tm_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex)
+inline int transaction::dir_tm_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex)
 {
    synchro::lock(latmMutex_);
    bool hasLock = true;

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 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -43,7 +43,7 @@
 //
 //----------------------------------------------------------------------------
 inline bool transaction::dir_do_core_tx_conflicting_lock_pthread_lock_mutex
-(latm_mutex mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable)
+(latm::mutex_type* mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable)
 {
    //--------------------------------------------------------------------------
    // see if this mutex is part of any of the in-flight transactions conflicting
@@ -96,7 +96,7 @@
       try
       {
          latmLockedLocksAndThreadIdsMap_.insert
- (std::make_pair<latm_mutex, ThreadIdSet>(mutex, txThreadId));
+ (std::make_pair<latm::mutex_type*, ThreadIdSet>(mutex, txThreadId));
          latmLockedLocksOfThreadMap_[mutex] = this_thread::get_id();
       }
       catch (...)
@@ -154,7 +154,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_tx_conflicting_lock_pthread_lock_mutex(latm_mutex mutex)
+inline int transaction::dir_tx_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex)
 {
    int waitTime = 0, aborted = 0;
 
@@ -245,7 +245,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_tx_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex)
+inline int transaction::dir_tx_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex)
 {
    //--------------------------------------------------------------------------
    throw "might not be possible to implement trylock for this";
@@ -296,7 +296,7 @@
 //----------------------------------------------------------------------------
 // only allow one thread to execute any of these methods at a time
 //----------------------------------------------------------------------------
-inline int transaction::dir_tx_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex)
+inline int transaction::dir_tx_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex)
 {
    synchro::lock_guard<Mutex> autolock_l(*latm_lock());
    synchro::lock_guard<Mutex> autolock_g(*general_lock());

Modified: sandbox/stm/branches/vbe/boost/stm/detail/latm_general_impl.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/latm_general_impl.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/latm_general_impl.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -61,7 +61,7 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline void boost::stm::transaction::add_to_obtained_locks(latm_mutex m)
+inline void boost::stm::transaction::add_to_obtained_locks(latm::mutex_type* m)
 {
    obtainedLocksRef().insert(m);
 
@@ -72,7 +72,7 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline bool boost::stm::transaction::is_on_obtained_locks_list(latm_mutex m)
+inline bool boost::stm::transaction::is_on_obtained_locks_list(latm::mutex_type* m)
 {
    return obtainedLocksRef().find(m) != obtainedLocksRef().end();
 }
@@ -80,21 +80,21 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline bool boost::stm::transaction::is_currently_locked_lock(latm_mutex m)
+inline bool boost::stm::transaction::is_currently_locked_lock(latm::mutex_type* m)
 {
    return currentlyLockedLocksRef().find(m) != currentlyLockedLocksRef().end();
 }
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline void boost::stm::transaction::add_to_currently_locked_locks(latm_mutex m)
+inline void boost::stm::transaction::add_to_currently_locked_locks(latm::mutex_type* m)
 {
    currentlyLockedLocksRef().insert(m);
 }
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline void boost::stm::transaction::remove_from_currently_locked_locks(latm_mutex m)
+inline void boost::stm::transaction::remove_from_currently_locked_locks(latm::mutex_type* m)
 {
    currentlyLockedLocksRef().erase(m);
 }
@@ -103,9 +103,9 @@
 //----------------------------------------------------------------------------
 inline void boost::stm::transaction::clear_latm_obtained_locks()
 {
- for (latm_mutex_set::iterator i = obtainedLocksRef().begin(); i != obtainedLocksRef().end();)
+ for (latm::mutex_set::iterator i = obtainedLocksRef().begin(); i != obtainedLocksRef().end();)
    {
- latm_mutex m = *i;
+ latm::mutex_type* m = *i;
       obtainedLocksRef().erase(i);
       i = obtainedLocksRef().begin();
 
@@ -133,7 +133,7 @@
 // prior to calling this method.
 //
 //----------------------------------------------------------------------------
-inline bool boost::stm::transaction::mutex_is_on_obtained_tx_list(latm_mutex mutex)
+inline bool boost::stm::transaction::mutex_is_on_obtained_tx_list(latm::mutex_type* mutex)
 {
 #ifdef BOOST_STM_HAVE_SINGLE_TSS_CONTEXT_MAP
    for (tss_context_map_type::iterator iter = tss_context_map_.begin();
@@ -145,7 +145,7 @@
       }
    }
 #else
- for (thread_latm_mutex_set::iterator iter = threadObtainedLocks_.begin();
+ for (latm::thread_id_mutex_set_map::iterator iter = threadObtainedLocks_.begin();
    threadObtainedLocks_.end() != iter; ++iter)
    {
       if (iter->second->find(mutex) != iter->second->end())
@@ -163,7 +163,7 @@
 // prior to calling this method.
 //
 //----------------------------------------------------------------------------
-inline void boost::stm::transaction::unblock_conflicting_threads(latm_mutex mutex)
+inline void boost::stm::transaction::unblock_conflicting_threads(latm::mutex_type* mutex)
 {
    // if the mutex is on the latm locks map, we can't unblock yet
    if (latmLockedLocksAndThreadIdsMap_.find(mutex) != latmLockedLocksAndThreadIdsMap_.end())
@@ -194,7 +194,7 @@
    // if the size is 0, unblock everybody
    if (latmLockedLocksOfThreadMap_.empty())
    {
- for (thread_latm_mutex_set::iterator it = threadObtainedLocks_.begin();
+ for (latm::thread_id_mutex_set_map::iterator it = threadObtainedLocks_.begin();
       it != threadObtainedLocks_.end(); ++it)
       {
          if (!it->second->empty()) return;
@@ -206,70 +206,9 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline bool boost::stm::transaction::doing_full_lock_protection()
+inline void boost::stm::transaction::tm_lock_conflict(latm::mutex_type* inLock)
 {
- return eFullLatmProtection == eLatmType_;
-}
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-inline void boost::stm::transaction::do_full_lock_protection()
-{
- eLatmType_ = eFullLatmProtection;
-}
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-inline bool boost::stm::transaction::doing_tm_lock_protection()
-{
- return eTmConflictingLockLatmProtection == eLatmType_;
-}
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-inline void boost::stm::transaction::do_tm_lock_protection()
-{
- eLatmType_ = eTmConflictingLockLatmProtection;
-}
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-inline bool boost::stm::transaction::doing_tx_lock_protection()
-{
- return eTxConflictingLockLatmProtection == eLatmType_;
-}
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-inline void boost::stm::transaction::do_tx_lock_protection()
-{
- eLatmType_ = eTxConflictingLockLatmProtection;
-}
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-inline std::string const boost::stm::transaction::latm_protection_str()
-{
- //using namespace boost::stm;
-
- switch (eLatmType_)
- {
- case eFullLatmProtection:
- return "full_protect";
- case eTmConflictingLockLatmProtection:
- return "tm_protect";
- case eTxConflictingLockLatmProtection:
- return "tx_protect";
- default:
- throw "invalid LATM type";
- }
-}
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-inline void boost::stm::transaction::tm_lock_conflict(latm_mutex inLock)
-{
- if (!doing_tm_lock_protection()) return;
+ if (!latm::instance().doing_tm_lock_protection()) return;
 
    //synchro::lock(latmMutex_);
    synchro::lock_guard<Mutex> lock_l(latmMutex_);
@@ -300,7 +239,7 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline void boost::stm::transaction::must_be_in_tm_conflicting_lock_set(latm_mutex inLock)
+inline void boost::stm::transaction::must_be_in_tm_conflicting_lock_set(latm::mutex_type* inLock)
 {
    if (tmConflictingLocks_.find(inLock) == tmConflictingLocks_.end())
    {
@@ -310,7 +249,7 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline void boost::stm::transaction::must_be_in_conflicting_lock_set(latm_mutex inLock)
+inline void boost::stm::transaction::must_be_in_conflicting_lock_set(latm::mutex_type* inLock)
 {
    if (get_tx_conflicting_locks().find(inLock) == get_tx_conflicting_locks().end())
    {
@@ -320,9 +259,9 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline void boost::stm::transaction::add_tx_conflicting_lock(latm_mutex inLock)
+inline void boost::stm::transaction::add_tx_conflicting_lock(latm::mutex_type* inLock)
 {
- if (!doing_tx_lock_protection()) return;
+ if (!latm::instance().doing_tx_lock_protection()) return;
 
    {
       synchro::lock_guard<Mutex> autolock_l(*latm_lock());
@@ -361,11 +300,11 @@
 // the client chose
 //
 //----------------------------------------------------------------------------
-inline int boost::stm::transaction::pthread_lock(latm_mutex mutex)
+inline int boost::stm::transaction::pthread_lock(latm::mutex_type* mutex)
 {
    //using namespace boost::stm;
 
- switch (eLatmType_)
+ switch (latm::instance().protection())
    {
    case eFullLatmProtection:
       if (direct_updating()) return dir_full_pthread_lock_mutex(mutex);
@@ -383,11 +322,11 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline int boost::stm::transaction::pthread_trylock(latm_mutex mutex)
+inline int boost::stm::transaction::pthread_trylock(latm::mutex_type* mutex)
 {
    //using namespace boost::stm;
 
- switch (eLatmType_)
+ switch (latm::instance().protection())
    {
    case eFullLatmProtection:
       if (direct_updating()) return dir_full_pthread_trylock_mutex(mutex);
@@ -405,11 +344,11 @@
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-inline int boost::stm::transaction::pthread_unlock(latm_mutex mutex)
+inline int boost::stm::transaction::pthread_unlock(latm::mutex_type* mutex)
 {
    //using namespace boost::stm;
 
- switch (eLatmType_)
+ switch (latm::instance().protection())
    {
    case eFullLatmProtection:
       if (direct_updating()) return dir_full_pthread_unlock_mutex(mutex);
@@ -446,7 +385,7 @@
    //--------------------------------------------------------------------------
    // iterate through all currently locked locks
    //--------------------------------------------------------------------------
- for (MutexThreadSetMap::iterator iter = latmLockedLocksAndThreadIdsMap_.begin();
+ for (latm::mutex_thread_id_set_map::iterator iter = latmLockedLocksAndThreadIdsMap_.begin();
    latmLockedLocksAndThreadIdsMap_.end() != iter; ++iter)
    {
       //-----------------------------------------------------------------------
@@ -462,15 +401,15 @@
 
    block_if_conflict_mutex();
 
- for (latm_mutex_set::iterator k = get_tx_conflicting_locks().begin(); k != get_tx_conflicting_locks().end(); ++k)
+ for (latm::mutex_set::iterator k = get_tx_conflicting_locks().begin(); k != get_tx_conflicting_locks().end(); ++k)
    {
       // if it is locked by our thread, it is ok ... otherwise it is not
- MutexThreadMap::iterator l = latmLockedLocksOfThreadMap_.find(*k);
+ latm::mutex_thread_id_map::iterator l = latmLockedLocksOfThreadMap_.find(*k);
 
       if (l != latmLockedLocksOfThreadMap_.end() &&
          this_thread::get_id() != l->second)
       {
- MutexThreadSetMap::iterator locksAndThreadsIter = latmLockedLocksAndThreadIdsMap_.find(*k);
+ latm::mutex_thread_id_set_map::iterator locksAndThreadsIter = latmLockedLocksAndThreadIdsMap_.find(*k);
 
          if (locksAndThreadsIter == latmLockedLocksAndThreadIdsMap_.end())
          {
@@ -478,7 +417,7 @@
             s.insert(this_thread::get_id());
 
             latmLockedLocksAndThreadIdsMap_.insert
- (std::make_pair<latm_mutex, ThreadIdSet>(*k, s));
+ (std::make_pair<latm::mutex_type*, ThreadIdSet>(*k, s));
          }
          else
          {
@@ -501,7 +440,7 @@
 {
    int count = 0;
 
- for (MutexThreadSetMap::iterator iter = latmLockedLocksAndThreadIdsMap_.begin();
+ for (latm::mutex_thread_id_set_map::iterator iter = latmLockedLocksAndThreadIdsMap_.begin();
       latmLockedLocksAndThreadIdsMap_.end() != iter; ++iter)
    {
       if (iter->second.find(threadId) != iter->second.end()) ++count;

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 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -520,7 +520,7 @@
 
    o << "Threads and their conflicting mutexes:" << endl << endl;
 
- for (thread_latm_mutex_set::iterator iter = threadConflictingMutexes_.begin();
+ for (latm::thread_id_mutex_set_map::iterator iter = threadConflictingMutexes_.begin();
    threadConflictingMutexes_.end() != iter; ++iter)
    {
       // if this mutex is found in the transaction's conflicting mutexes
@@ -530,7 +530,7 @@
       o << iter->first << " blocked: " << blocked(iter->first) << endl;
       o << "\t";
 
- for (latm_mutex_set::iterator inner = iter->second->begin(); inner != iter->second->end(); ++inner)
+ for (latm::mutex_set::iterator inner = iter->second->begin(); inner != iter->second->end(); ++inner)
       {
          o << *inner << " ";
       }
@@ -539,7 +539,7 @@
 
    o << "Currently locked locks:" << endl << endl;
 
- for (MutexThreadSetMap::iterator i = latmLockedLocksAndThreadIdsMap_.begin();
+ for (latm::mutex_thread_id_set_map::iterator i = latmLockedLocksAndThreadIdsMap_.begin();
    i != latmLockedLocksAndThreadIdsMap_.end(); ++i)
    {
       o << i->first << endl << "\t";
@@ -623,9 +623,9 @@
    // if we're doing full lock protection, allow transactions
    // to start only if no locks are obtained or the only lock that
    // is obtained is on this_thread::get_id()
- if (transaction::doing_full_lock_protection())
+ if (latm::instance().doing_full_lock_protection())
    {
- for (MutexThreadMap::iterator j = latmLockedLocksOfThreadMap_.begin();
+ for (latm::mutex_thread_id_map::iterator j = latmLockedLocksOfThreadMap_.begin();
       j != latmLockedLocksOfThreadMap_.end(); ++j)
       {
          if (this_thread::get_id() != j->second)
@@ -637,15 +637,15 @@
 
    // if we're doing tm lock protection, allow transactions
    // to start only if
- else if (transaction::doing_tm_lock_protection())
+ else if (latm::instance().doing_tm_lock_protection())
    {
- for (latm_mutex_set::iterator i = tmConflictingLocks_.begin(); i != tmConflictingLocks_.end(); ++i)
+ for (latm::mutex_set::iterator i = tmConflictingLocks_.begin(); i != tmConflictingLocks_.end(); ++i)
       {
          // if one of your conflicting locks is currently locked ...
          if (latmLockedLocks_.end() != latmLockedLocks_.find(*i))
          {
             // if it is locked by our thread, it is ok ... otherwise it is not
- MutexThreadMap::iterator j = latmLockedLocksOfThreadMap_.find(*i);
+ latm::mutex_thread_id_map::iterator j = latmLockedLocksOfThreadMap_.find(*i);
 
             if (j != latmLockedLocksOfThreadMap_.end() &&
                this_thread::get_id() != j->second)

Added: sandbox/stm/branches/vbe/boost/stm/latm.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/latm.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -0,0 +1,21 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Justin E. Gottchlich 2009.
+// (C) Copyright Vicente J. Botet Escriba 2009.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STM_LATM__HPP
+#define BOOST_STM_LATM__HPP
+
+#include <boost/stm/latm/selector.hpp>
+
+#endif // BOOST_STM_LATM__HPP
+
+

Added: sandbox/stm/branches/vbe/boost/stm/latm/base_mode.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/latm/base_mode.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Justin E. Gottchlich 2009.
+// (C) Copyright Vicente J. Botet Escriba 2009.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STM_LATM_BASE_MODE__HPP
+#define BOOST_STM_LATM_BASE_MODE__HPP
+
+#include <boost/stm/detail/config.hpp>
+#include <boost/stm/latm/datatypes.hpp>
+
+namespace boost { namespace stm { namespace latm {
+
+ class base_mode {
+ public:
+ virtual latm_type const protection() =0;
+ virtual std::string const protection_str();
+
+ virtual bool doing_full_lock_protection();
+ virtual bool doing_tm_lock_protection();
+ virtual bool doing_tx_lock_protection();
+
+ virtual void lock(mutex_type& lock);
+ virtual bool try_lock(mutex_type& lock);
+ virtual void unlock(mutex_type& lock);
+ };
+
+}}}
+
+#endif // BOOST_STM_LATM_DYNAMIC__HPP
+
+

Added: sandbox/stm/branches/vbe/boost/stm/latm/datatypes.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/latm/datatypes.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Justin E. Gottchlich 2009.
+// (C) Copyright Vicente J. Botet Escriba 2009.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STM_LATM_DATATYPES__HPP
+#define BOOST_STM_LATM_DATATYPES__HPP
+
+#include <boost/stm/detail/config.hpp>
+#include <boost/stm/datatypes.hpp>
+#include <set>
+#include <map>
+
+namespace boost { namespace stm { namespace latm {
+#if BOOST_STM_LATM_GENERIC
+ //typedef synchro::poly::mutex mutex_type;
+#else
+ typedef Mutex mutex_type;
+#endif
+
+ typedef std::set<thread_id_t> thread_id_set;
+
+ typedef std::set<mutex_type*> mutex_set;
+ //typedef std::map<thread_id_t, mutex_set* > thread_mutex_set_map;
+ typedef std::map<thread_id_t, mutex_set* > thread_id_mutex_set_map;
+
+ //typedef std::map<latm::mutex_type*, thread_id_set > MutexThreadSetMap;
+ typedef std::map<mutex_type*, thread_id_set > mutex_thread_id_set_map;
+
+ //typedef std::map<latm::mutex_type*, thread_id_t> MutexThreadMap;
+ typedef std::map<mutex_type*, thread_id_t> mutex_thread_id_map;
+
+}}}
+
+#endif // BOOST_STM_LATM_DATATYPES__HPP
+
+

Added: sandbox/stm/branches/vbe/boost/stm/latm/dynamic.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/latm/dynamic.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -0,0 +1,112 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Justin E. Gottchlich 2009.
+// (C) Copyright Vicente J. Botet Escriba 2009.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STM_LATM_DYNAMIC__HPP
+#define BOOST_STM_LATM_DYNAMIC__HPP
+
+#include <boost/stm/detail/config.hpp>
+#include <boost/stm/latm/datatypes.hpp>
+
+namespace boost { namespace stm { namespace latm {
+ #if 0
+ struct poly {
+ static full_mode<base_mode> full_;
+ static tm_mode<base_mode> tm_;
+ static tx_mode<base_mode> tx_;
+ static base_mode* more_;
+ };
+ void do_full_lock_protection() {
+ poly::mode_ = &full_;
+ }
+ void do_tm_lock_protection() {
+ poly::mode_ = &tm_;
+ }
+ void do_tx_lock_protection() {
+ poly::mode_ = &tx_;
+ }
+ inline base_mode& instance() {
+ return poly::mode_;
+ }
+
+ #endif
+ class dynamic {
+ latm_type eLatmType_;
+ public:
+ dynamic() : eLatmType_(eFullLatmProtection) {}
+ latm_type const protection() { return eLatmType_; }
+ std::string const protection_str() {
+ switch (eLatmType_)
+ {
+ case eFullLatmProtection:
+ return "full_protect";
+ case eTmConflictingLockLatmProtection:
+ return "tm_protect";
+ case eTxConflictingLockLatmProtection:
+ return "tx_protect";
+ default:
+ throw "invalid LATM type";
+ }
+ }
+ void do_full_lock_protection_i() {
+ eLatmType_ = eFullLatmProtection;
+ }
+ void do_tm_lock_protection_i() {
+ eLatmType_ = eTmConflictingLockLatmProtection;
+ }
+ void do_tx_lock_protection_i() {
+ eLatmType_ = eTxConflictingLockLatmProtection;
+ }
+
+ bool doing_full_lock_protection() {
+ return eFullLatmProtection == eLatmType_;
+ }
+ bool doing_tm_lock_protection() {
+ return eTmConflictingLockLatmProtection == eLatmType_;
+ }
+ bool doing_tx_lock_protection() {
+ return eTxConflictingLockLatmProtection == eLatmType_;
+ }
+
+#if BOOST_STM_LATM_GENERIC
+ template <typename Lockable>
+ void lock(Lockable& lock);
+ template <typename Lockable>
+ bool try_lock(Lockable& lock);
+ template <typename Lockable>
+ void unlock(Lockable& lock);
+#else
+ int lock(mutex_type& lock);
+ int try_lock(mutex_type& lock);
+ int unlock(mutex_type& lock);
+#endif
+
+ };
+ inline dynamic& instance() {
+ static dynamic ctx;
+ return ctx;
+ }
+ inline void do_full_lock_protection() {
+ instance().do_full_lock_protection_i();
+ }
+ inline void do_tm_lock_protection() {
+ instance().do_tm_lock_protection_i();
+ }
+ inline void do_tx_lock_protection() {
+ instance().do_tx_lock_protection_i();
+ }
+
+}}}
+
+#endif // BOOST_STM_LATM_DYNAMIC__HPP
+
+

Added: sandbox/stm/branches/vbe/boost/stm/latm/full.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/latm/full.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -0,0 +1,51 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Justin E. Gottchlich 2009.
+// (C) Copyright Vicente J. Botet Escriba 2009.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STM_LATM_DYNAMIC__HPP
+#define BOOST_STM_LATM_DYNAMIC__HPP
+
+#include <boost/stm/detail/config.hpp>
+#include <boost/stm/latm/datatypes.hpp>
+
+namespace boost { namespace stm { namespace latm {
+
+ struct static_mode {};
+ template <typename Base=static_mode>
+ class full_mode : {
+ public:
+ latm_type const protection() { return eFullLatmProtection; }
+ std::string const protection_str() {
+ return "full_protect";
+ }
+
+ bool doing_full_lock_protection() {
+ return true;
+ }
+ bool doing_tm_lock_protection() {
+ return false;
+ }
+ bool doing_tx_lock_protection() {
+ return false;
+ }
+
+ int lock(mutex_type& lock);
+ int try_lock(mutex_type& lock);
+ int unlock(mutex_type& lock);
+
+ };
+
+}}}
+
+#endif // BOOST_STM_LATM_DYNAMIC__HPP
+
+

Added: sandbox/stm/branches/vbe/boost/stm/latm/selector.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/latm/selector.hpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Justin E. Gottchlich 2009.
+// (C) Copyright Vicente J. Botet Escriba 2009.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STM_LATM_SELECTOR__HPP
+#define BOOST_STM_LATM_SELECTOR__HPP
+
+//-----------------------------------------------------------------------------
+#include <boost/stm/detail/config.hpp>
+//-----------------------------------------------------------------------------
+
+#if defined(BOOST_STM_LATM_STATIC_CONF)
+#include BOOST_STM_LATM_STATIC_CONF
+#else
+#include <boost/stm/latm/dynamic.hpp>
+#endif
+
+#endif // BOOST_STM_LATM_SELECTOR__HPP

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 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -35,6 +35,7 @@
 #include <boost/stm/transaction_bookkeeping.hpp>
 #include <boost/stm/contention_managers/select_contention_manager.hpp>
 #include <boost/stm/memory_managers/base_memory_manager.hpp>
+#include <boost/stm/latm.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/detail/bloom_filter.hpp>
 #include <boost/stm/detail/deleters.hpp>
@@ -101,10 +102,6 @@
 
    typedef std::multimap<clock_t, MemoryContainerList > DeletionBuffer;
 
- //typedef std::set<Mutex*> MutexSet;
- //typedef void* latm_mutex;
- typedef Mutex* latm_mutex;
- typedef std::set<latm_mutex> latm_mutex_set;
 
    typedef std::set<thread_id_t> ThreadIdSet;
 
@@ -117,8 +114,6 @@
     typedef std::map<thread_id_t, Mutex*> ThreadMutexContainer;
     #endif
 
- //typedef std::map<thread_id_t, MutexSet* > ThreadMutexSetContainer;
- typedef std::map<thread_id_t, latm_mutex_set* > thread_latm_mutex_set;
    typedef std::map<thread_id_t, bloom_filter*> ThreadBloomFilterList;
     #ifdef BOOST_STM_BLOOM_FILTER_USE_DYNAMIC_BITSET
     typedef std::map<thread_id_t, boost::dynamic_bitset<>*> ThreadBitVectorList;
@@ -132,10 +127,6 @@
    typedef std::map<thread_id_t, int*> ThreadBoolContainer;
     #endif
 
- typedef std::map<latm_mutex, ThreadIdSet > MutexThreadSetMap;
- typedef std::map<latm_mutex, thread_id_t> MutexThreadMap;
- //typedef std::map<Mutex*, thread_id_t> latm_mutex_thread_map;
-
    typedef std::set<transaction*> LockedTransactionContainer;
 
    typedef InflightTxes in_flight_transaction_container;
@@ -192,10 +183,10 @@
         #endif
         #if PERFORMING_LATM
         #if USING_TRANSACTION_SPECIFIC_LATM
- latm_mutex_set conflictingMutex_;
+ latm::mutex_set conflictingMutex_;
         #endif
- latm_mutex_set obtainedLocks_;
- latm_mutex_set currentlyLockedLocks_;
+ latm::mutex_set obtainedLocks_;
+ latm::mutex_set currentlyLockedLocks_;
         #endif
     };
 
@@ -314,16 +305,6 @@
    //--------------------------------------------------------------------------
    // Lock Aware Transactional Memory support methods
    //--------------------------------------------------------------------------
- inline static LatmType const latm_protection() { return eLatmType_; }
- static std::string const latm_protection_str();
- static void do_full_lock_protection();
- static void do_tm_lock_protection();
- static void do_tx_lock_protection();
-
- static bool doing_full_lock_protection();
- static bool doing_tm_lock_protection();
- static bool doing_tx_lock_protection();
-
 
     #ifdef WIN32
    template <typename T>
@@ -363,11 +344,9 @@
    inline static int unlock_(PLOCK *lock) { return pthread_unlock(lock); }
     #endif
 
- static int pthread_lock(latm_mutex lock);
- static int pthread_trylock(latm_mutex lock);
- static int pthread_unlock(latm_mutex lock);
-
-
+ static int pthread_lock(latm::mutex_type* lock);
+ static int pthread_trylock(latm::mutex_type* lock);
+ static int pthread_unlock(latm::mutex_type* lock);
 
    //--------------------------------------------------------------------------
     #if PERFORMING_LATM
@@ -376,13 +355,13 @@
    {
       tm_lock_conflict(&lock);
    }
- static void tm_lock_conflict(latm_mutex lock);
+ static void tm_lock_conflict(latm::mutex_type* lock);
 
    static void clear_tm_conflicting_locks();
- inline static latm_mutex_set get_tm_conflicting_locks() { return tmConflictingLocks_; }
+ inline static latm::mutex_set get_tm_conflicting_locks() { return tmConflictingLocks_; }
 
- void must_be_in_conflicting_lock_set(latm_mutex inLock);
- static void must_be_in_tm_conflicting_lock_set(latm_mutex inLock);
+ void must_be_in_conflicting_lock_set(latm::mutex_type* inLock);
+ static void must_be_in_tm_conflicting_lock_set(latm::mutex_type* inLock);
 
     #if USING_TRANSACTION_SPECIFIC_LATM
    void see_if_tx_must_block_due_to_tx_latm();
@@ -390,29 +369,29 @@
    inline void lock_conflict(Mutex &lock)
    { add_tx_conflicting_lock(&lock); }
 
- inline void lock_conflict(latm_mutex lock)
+ inline void lock_conflict(latm::mutex_type* lock)
    { add_tx_conflicting_lock(lock); }
 
    inline void add_tx_conflicting_lock(Mutex &lock)
    {
       add_tx_conflicting_lock(&lock);
    }
- void add_tx_conflicting_lock(latm_mutex lock);
+ void add_tx_conflicting_lock(latm::mutex_type* lock);
 
    void clear_tx_conflicting_locks();
- //latm_mutex_set get_tx_conflicting_locks() { return conflictingMutexRef_; }
+ //latm::mutex_set get_tx_conflicting_locks() { return conflictingMutexRef_; }
     #endif
 
- void add_to_obtained_locks(latm_mutex mutex);
- static void unblock_conflicting_threads(latm_mutex mutex);
- static bool mutex_is_on_obtained_tx_list(latm_mutex mutex);
+ void add_to_obtained_locks(latm::mutex_type* mutex);
+ static void unblock_conflicting_threads(latm::mutex_type* mutex);
+ static bool mutex_is_on_obtained_tx_list(latm::mutex_type* mutex);
    static void unblock_threads_if_locks_are_empty();
    void clear_latm_obtained_locks();
 
- void add_to_currently_locked_locks(latm_mutex m);
- void remove_from_currently_locked_locks(latm_mutex m);
- bool is_currently_locked_lock(latm_mutex m);
- bool is_on_obtained_locks_list(latm_mutex m);
+ void add_to_currently_locked_locks(latm::mutex_type* m);
+ void remove_from_currently_locked_locks(latm::mutex_type* m);
+ bool is_currently_locked_lock(latm::mutex_type* m);
+ bool is_on_obtained_locks_list(latm::mutex_type* m);
     #endif
 
    //--------------------------------------------------------------------------
@@ -1274,21 +1253,21 @@
    // deferred updating methods
    //--------------------------------------------------------------------------
    static bool def_do_core_tm_conflicting_lock_pthread_lock_mutex
- (latm_mutex mutex, int lockWaitTime, int lockAborted);
+ (latm::mutex_type* mutex, int lockWaitTime, int lockAborted);
    static bool def_do_core_tx_conflicting_lock_pthread_lock_mutex
- (latm_mutex mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable);
+ (latm::mutex_type* mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable);
    static bool def_do_core_full_pthread_lock_mutex
- (latm_mutex mutex, int lockWaitTime, int lockAborted);
+ (latm::mutex_type* mutex, int lockWaitTime, int lockAborted);
 
    //--------------------------------------------------------------------------
    // direct updating methods
    //--------------------------------------------------------------------------
    static bool dir_do_core_tm_conflicting_lock_pthread_lock_mutex
- (latm_mutex mutex, int lockWaitTime, int lockAborted);
+ (latm::mutex_type* mutex, int lockWaitTime, int lockAborted);
    static bool dir_do_core_tx_conflicting_lock_pthread_lock_mutex
- (latm_mutex mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable);
+ (latm::mutex_type* mutex, int lockWaitTime, int lockAborted, bool txIsIrrevocable);
    static bool dir_do_core_full_pthread_lock_mutex
- (latm_mutex mutex, int lockWaitTime, int lockAborted);
+ (latm::mutex_type* mutex, int lockWaitTime, int lockAborted);
 
    static int thread_id_occurance_in_locked_locks_map(thread_id_t threadId);
 
@@ -1297,32 +1276,32 @@
    //--------------------------------------------------------------------------
    // deferred updating locking methods
    //--------------------------------------------------------------------------
- static int def_full_pthread_lock_mutex(latm_mutex mutex);
- static int def_full_pthread_trylock_mutex(latm_mutex mutex);
- static int def_full_pthread_unlock_mutex(latm_mutex mutex);
-
- static int def_tm_conflicting_lock_pthread_lock_mutex(latm_mutex mutex);
- static int def_tm_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex);
- static int def_tm_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex);
-
- static int def_tx_conflicting_lock_pthread_lock_mutex(latm_mutex mutex);
- static int def_tx_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex);
- static int def_tx_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex);
+ static int def_full_pthread_lock_mutex(latm::mutex_type* mutex);
+ static int def_full_pthread_trylock_mutex(latm::mutex_type* mutex);
+ static int def_full_pthread_unlock_mutex(latm::mutex_type* mutex);
+
+ static int def_tm_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex);
+ static int def_tm_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex);
+ static int def_tm_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex);
+
+ static int def_tx_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex);
+ static int def_tx_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex);
+ static int def_tx_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex);
 
    //--------------------------------------------------------------------------
    // direct updating locking methods
    //--------------------------------------------------------------------------
- static int dir_full_pthread_lock_mutex(latm_mutex mutex);
- static int dir_full_pthread_trylock_mutex(latm_mutex mutex);
- static int dir_full_pthread_unlock_mutex(latm_mutex mutex);
-
- static int dir_tm_conflicting_lock_pthread_lock_mutex(latm_mutex mutex);
- static int dir_tm_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex);
- static int dir_tm_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex);
-
- static int dir_tx_conflicting_lock_pthread_lock_mutex(latm_mutex mutex);
- static int dir_tx_conflicting_lock_pthread_trylock_mutex(latm_mutex mutex);
- static int dir_tx_conflicting_lock_pthread_unlock_mutex(latm_mutex mutex);
+ static int dir_full_pthread_lock_mutex(latm::mutex_type* mutex);
+ static int dir_full_pthread_trylock_mutex(latm::mutex_type* mutex);
+ static int dir_full_pthread_unlock_mutex(latm::mutex_type* mutex);
+
+ static int dir_tm_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex);
+ static int dir_tm_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex);
+ static int dir_tm_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex);
+
+ static int dir_tx_conflicting_lock_pthread_lock_mutex(latm::mutex_type* mutex);
+ static int dir_tx_conflicting_lock_pthread_trylock_mutex(latm::mutex_type* mutex);
+ static int dir_tx_conflicting_lock_pthread_unlock_mutex(latm::mutex_type* mutex);
 
    //--------------------------------------------------------------------------
 
@@ -1330,11 +1309,11 @@
    static DeletionBuffer deletionBuffer_;
    static std::ofstream logFile_;
 
- static latm_mutex_set tmConflictingLocks_;
- static latm_mutex_set latmLockedLocks_;
- static MutexThreadSetMap latmLockedLocksAndThreadIdsMap_;
- static MutexThreadMap latmLockedLocksOfThreadMap_;
- static LatmType eLatmType_;
+ static latm::mutex_set tmConflictingLocks_;
+ static latm::mutex_set latmLockedLocks_;
+ static latm::mutex_thread_id_set_map latmLockedLocksAndThreadIdsMap_;
+ static latm::mutex_thread_id_map latmLockedLocksOfThreadMap_;
+ //static LatmType eLatmType_;
    static InflightTxes transactionsInFlight_;
 
    static Mutex deletionBufferMutex_;
@@ -1502,18 +1481,18 @@
 
 
 #if PERFORMING_LATM
- static thread_latm_mutex_set threadConflictingMutexes_;
- static thread_latm_mutex_set threadObtainedLocks_;
- static thread_latm_mutex_set threadCurrentlyLockedLocks_;
+ static latm::thread_id_mutex_set_map threadConflictingMutexes_;
+ static latm::thread_id_mutex_set_map threadObtainedLocks_;
+ static latm::thread_id_mutex_set_map threadCurrentlyLockedLocks_;
 
 #if USING_TRANSACTION_SPECIFIC_LATM
- latm_mutex_set &conflictingMutexRef_;
- inline latm_mutex_set& get_tx_conflicting_locks() { return conflictingMutexRef_; }
- inline latm_mutex_set& get_tx_conflicting_locks(thread_id_t id) {
+ latm::mutex_set &conflictingMutexRef_;
+ inline latm::mutex_set& get_tx_conflicting_locks() { return conflictingMutexRef_; }
+ inline latm::mutex_set& get_tx_conflicting_locks(thread_id_t id) {
        return *threadConflictingMutexes_.find(threadId_)->second;
     }
     static void thread_conflicting_mutexes_set_all(int b) {
- for (thread_latm_mutex_set::iterator iter = threadConflictingMutexes_.begin();
+ for (latm::thread_id_mutex_set_map::iterator iter = threadConflictingMutexes_.begin();
             threadConflictingMutexes_.end() != iter; ++iter)
         {
             blocked(iter->first) = b;
@@ -1521,7 +1500,7 @@
     }
 
     static void thread_conflicting_mutexes_set_all_cnd(Mutex *mutex, int b) {
- for (thread_latm_mutex_set::iterator iter = threadConflictingMutexes_.begin();
+ for (latm::thread_id_mutex_set_map::iterator iter = threadConflictingMutexes_.begin();
             threadConflictingMutexes_.end() != iter; ++iter)
         {
         // if this mutex is found in the transaction's conflicting mutexes
@@ -1537,21 +1516,21 @@
    }
 #endif
 
- latm_mutex_set &obtainedLocksRef_;
- inline latm_mutex_set &obtainedLocksRef() {return obtainedLocksRef_;}
- inline static latm_mutex_set &obtainedLocksRef(thread_id_t id) {return *threadObtainedLocks_.find(id)->second;}
+ latm::mutex_set &obtainedLocksRef_;
+ inline latm::mutex_set &obtainedLocksRef() {return obtainedLocksRef_;}
+ inline static latm::mutex_set &obtainedLocksRef(thread_id_t id) {return *threadObtainedLocks_.find(id)->second;}
 
     void block_if_conflict_mutex() {
         //--------------------------------------------------------------------------
         // iterate through all currently locked locks
         //--------------------------------------------------------------------------
- for (thread_latm_mutex_set::iterator i = threadObtainedLocks_.begin();
+ for (latm::thread_id_mutex_set_map::iterator i = threadObtainedLocks_.begin();
         threadObtainedLocks_.end() != i; ++i)
         {
             // if these are locks obtained by this thread (in a parent tx), don't block
             if (i->first == this_thread::get_id()) continue;
 
- for (latm_mutex_set::iterator j = i->second->begin(); j != i->second->end(); ++j)
+ for (latm::mutex_set::iterator j = i->second->begin(); j != i->second->end(); ++j)
             {
                 //-----------------------------------------------------------------------
                 // iterate through this transaction's conflicting mutex ref - if one of
@@ -1566,9 +1545,9 @@
         }
    }
 
- latm_mutex_set &currentlyLockedLocksRef_;
- inline latm_mutex_set &currentlyLockedLocksRef() {return currentlyLockedLocksRef_;}
- inline static latm_mutex_set &currentlyLockedLocksRef(thread_id_t id) {return *threadCurrentlyLockedLocks_.find(id)->second;}
+ latm::mutex_set &currentlyLockedLocksRef_;
+ inline latm::mutex_set &currentlyLockedLocksRef() {return currentlyLockedLocksRef_;}
+ inline static latm::mutex_set &currentlyLockedLocksRef(thread_id_t id) {return *threadCurrentlyLockedLocks_.find(id)->second;}
 #endif
 
 
@@ -1660,8 +1639,8 @@
 #if PERFORMING_LATM
 
 #if USING_TRANSACTION_SPECIFIC_LATM
- inline latm_mutex_set& get_tx_conflicting_locks() { return context_.conflictingMutex_; }
- inline latm_mutex_set& get_tx_conflicting_locks(thread_id_t id) {
+ inline latm::mutex_set& get_tx_conflicting_locks() { return context_.conflictingMutex_; }
+ inline latm::mutex_set& get_tx_conflicting_locks(thread_id_t id) {
         tss_context_map_type::iterator i = tss_context_map_.find(id);
         return i->second->conflictingMutex_;
     }
@@ -1673,7 +1652,7 @@
         }
     }
 
- static void thread_conflicting_mutexes_set_all_cnd(latm_mutex mutex, int b) {
+ static void thread_conflicting_mutexes_set_all_cnd(latm::mutex_type* mutex, int b) {
         for (tss_context_map_type::iterator iter = tss_context_map_.begin();
             tss_context_map_.end() != iter; ++iter)
         {
@@ -1690,8 +1669,8 @@
    }
 #endif
 
- inline latm_mutex_set &obtainedLocksRef() {return context_.obtainedLocks_;}
- inline static latm_mutex_set &obtainedLocksRef(thread_id_t id) {
+ inline latm::mutex_set &obtainedLocksRef() {return context_.obtainedLocks_;}
+ inline static latm::mutex_set &obtainedLocksRef(thread_id_t id) {
         tss_context_map_type::iterator i = tss_context_map_.find(id);
         return i->second->obtainedLocks_;
     }
@@ -1706,7 +1685,7 @@
             // if these are locks obtained by this thread (in a parent tx), don't block
             if (i->first == this_thread::get_id()) continue;
 
- for (latm_mutex_set::iterator j = i->second->obtainedLocks_.begin(); j != i->second->obtainedLocks_.end(); ++j)
+ for (latm::mutex_set::iterator j = i->second->obtainedLocks_.begin(); j != i->second->obtainedLocks_.end(); ++j)
             {
                 //-----------------------------------------------------------------------
                 // iterate through this transaction's conflicting mutex ref - if one of
@@ -1722,8 +1701,8 @@
    }
 
 
- inline latm_mutex_set &currentlyLockedLocksRef() {return context_.currentlyLockedLocks_;}
- inline static latm_mutex_set &currentlyLockedLocksRef(thread_id_t id) {
+ inline latm::mutex_set &currentlyLockedLocksRef() {return context_.currentlyLockedLocks_;}
+ inline static latm::mutex_set &currentlyLockedLocksRef(thread_id_t id) {
         tss_context_map_type::iterator i = tss_context_map_.find(id);
         return i->second->currentlyLockedLocks_;
     }
@@ -1796,26 +1775,26 @@
 
 
 #if PERFORMING_LATM
- static thread_latm_mutex_set threadConflictingMutexes_;
- static thread_latm_mutex_set threadObtainedLocks_;
- static thread_latm_mutex_set threadCurrentlyLockedLocks_;
+ static latm::thread_id_mutex_set_map threadConflictingMutexes_;
+ static latm::thread_id_mutex_set_map threadObtainedLocks_;
+ static latm::thread_id_mutex_set_map threadCurrentlyLockedLocks_;
 
 #if USING_TRANSACTION_SPECIFIC_LATM
- latm_mutex_set &conflictingMutexRef_;
- inline latm_mutex_set& get_tx_conflicting_locks() { return conflictingMutexRef_; }
- inline latm_mutex_set& get_tx_conflicting_locks(thread_id_t id) {
+ latm::mutex_set &conflictingMutexRef_;
+ inline latm::mutex_set& get_tx_conflicting_locks() { return conflictingMutexRef_; }
+ inline latm::mutex_set& get_tx_conflicting_locks(thread_id_t id) {
        return *threadConflictingMutexes_.find(threadId_)->second;
     }
     static void thread_conflicting_mutexes_set_all(int b) {
- for (thread_latm_mutex_set::iterator iter = threadConflictingMutexes_.begin();
+ for (latm::thread_id_mutex_set_map::iterator iter = threadConflictingMutexes_.begin();
             threadConflictingMutexes_.end() != iter; ++iter)
         {
             blocked(iter->first) = b;
         }
     }
 
- static void thread_conflicting_mutexes_set_all_cnd(latm_mutex mutex, int b) {
- for (thread_latm_mutex_set::iterator iter = threadConflictingMutexes_.begin();
+ static void thread_conflicting_mutexes_set_all_cnd(latm::mutex_type* mutex, int b) {
+ for (latm::thread_id_mutex_set_map::iterator iter = threadConflictingMutexes_.begin();
             threadConflictingMutexes_.end() != iter; ++iter)
         {
         // if this mutex is found in the transaction's conflicting mutexes
@@ -1831,21 +1810,21 @@
    }
 #endif
 
- latm_mutex_set &obtainedLocksRef_;
- inline latm_mutex_set &obtainedLocksRef() {return obtainedLocksRef_;}
- inline static latm_mutex_set &obtainedLocksRef(thread_id_t id) {return *threadObtainedLocks_.find(id)->second;}
+ latm::mutex_set &obtainedLocksRef_;
+ inline latm::mutex_set &obtainedLocksRef() {return obtainedLocksRef_;}
+ inline static latm::mutex_set &obtainedLocksRef(thread_id_t id) {return *threadObtainedLocks_.find(id)->second;}
 
     void block_if_conflict_mutex() {
         //--------------------------------------------------------------------------
         // iterate through all currently locked locks
         //--------------------------------------------------------------------------
- for (thread_latm_mutex_set::iterator i = threadObtainedLocks_.begin();
+ for (latm::thread_id_mutex_set_map::iterator i = threadObtainedLocks_.begin();
         threadObtainedLocks_.end() != i; ++i)
         {
             // if these are locks obtained by this thread (in a parent tx), don't block
             if (i->first == this_thread::get_id()) continue;
 
- for (latm_mutex_set::iterator j = i->second->begin(); j != i->second->end(); ++j)
+ for (latm::mutex_set::iterator j = i->second->begin(); j != i->second->end(); ++j)
             {
                 //-----------------------------------------------------------------------
                 // iterate through this transaction's conflicting mutex ref - if one of
@@ -1862,9 +1841,9 @@
 
 
 
- latm_mutex_set &currentlyLockedLocksRef_;
- inline latm_mutex_set &currentlyLockedLocksRef() {return currentlyLockedLocksRef_;}
- inline static latm_mutex_set &currentlyLockedLocksRef(thread_id_t id) {return *threadCurrentlyLockedLocks_.find(id)->second;}
+ latm::mutex_set &currentlyLockedLocksRef_;
+ inline latm::mutex_set &currentlyLockedLocksRef() {return currentlyLockedLocksRef_;}
+ inline static latm::mutex_set &currentlyLockedLocksRef(thread_id_t id) {return *threadCurrentlyLockedLocks_.find(id)->second;}
 #endif
 
 

Modified: sandbox/stm/branches/vbe/libs/stm/src/transaction.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/src/transaction.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/src/transaction.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -31,10 +31,10 @@
 // Static initialization
 ///////////////////////////////////////////////////////////////////////////////
 transaction::InflightTxes transaction::transactionsInFlight_;
-transaction::latm_mutex_set transaction::latmLockedLocks_;
-transaction::MutexThreadSetMap transaction::latmLockedLocksAndThreadIdsMap_;
-transaction::MutexThreadMap transaction::latmLockedLocksOfThreadMap_;
-transaction::latm_mutex_set transaction::tmConflictingLocks_;
+latm::mutex_set transaction::latmLockedLocks_;
+latm::mutex_thread_id_set_map transaction::latmLockedLocksAndThreadIdsMap_;
+latm::mutex_thread_id_map transaction::latmLockedLocksOfThreadMap_;
+latm::mutex_set transaction::tmConflictingLocks_;
 transaction::DeletionBuffer transaction::deletionBuffer_;
 
 clock_t transaction::global_clock_ = 0;
@@ -52,7 +52,6 @@
 Mutex transaction::deletionBufferMutex_;
 Mutex transaction::latmMutex_;
 
-boost::stm::LatmType transaction::eLatmType_ = eFullLatmProtection;
 std::ofstream transaction::logFile_;
 
 #ifndef BOOST_STM_USE_BOOST_MUTEX
@@ -96,10 +95,10 @@
 #ifndef USE_SINGLE_THREAD_CONTEXT_MAP
 #if PERFORMING_LATM
 #if USING_TRANSACTION_SPECIFIC_LATM
-transaction::thread_latm_mutex_set transaction::threadConflictingMutexes_;
+latm::thread_id_mutex_set_map transaction::threadConflictingMutexes_;
 #endif
-transaction::thread_latm_mutex_set transaction::threadObtainedLocks_;
-transaction::thread_latm_mutex_set transaction::threadCurrentlyLockedLocks_;
+latm::thread_id_mutex_set_map transaction::threadObtainedLocks_;
+latm::thread_id_mutex_set_map transaction::threadCurrentlyLockedLocks_;
 #endif
 transaction::ThreadWriteContainer transaction::threadWriteLists_;
 transaction::ThreadReadContainer transaction::threadReadLists_;
@@ -117,10 +116,10 @@
 #ifndef BOOST_STM_HAVE_SINGLE_TSS_CONTEXT_MAP
 #if PERFORMING_LATM
 #if USING_TRANSACTION_SPECIFIC_LATM
-transaction::thread_latm_mutex_set transaction::threadConflictingMutexes_;
+latm::thread_id_mutex_set_map transaction::threadConflictingMutexes_;
 #endif
-transaction::thread_latm_mutex_set transaction::threadObtainedLocks_;
-transaction::thread_latm_mutex_set transaction::threadCurrentlyLockedLocks_;
+latm::thread_id_mutex_set_map transaction::threadObtainedLocks_;
+latm::thread_id_mutex_set_map transaction::threadCurrentlyLockedLocks_;
 #endif
 transaction::ThreadMutexContainer transaction::threadMutexes_;
 transaction::ThreadBoolContainer transaction::threadBlockedLists_;
@@ -218,23 +217,23 @@
 
 #if PERFORMING_LATM
 #if USING_TRANSACTION_SPECIFIC_LATM
- thread_latm_mutex_set::iterator conflictingMutexIter = threadConflictingMutexes_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator conflictingMutexIter = threadConflictingMutexes_.find(threadId);
    if (threadConflictingMutexes_.end() == conflictingMutexIter)
    {
- threadConflictingMutexes_[threadId] = new latm_mutex_set;
+ threadConflictingMutexes_[threadId] = new latm::mutex_set;
    }
 #endif
 
- thread_latm_mutex_set::iterator obtainedLocksIter = threadObtainedLocks_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator obtainedLocksIter = threadObtainedLocks_.find(threadId);
    if (threadObtainedLocks_.end() == obtainedLocksIter)
    {
- threadObtainedLocks_[threadId] = new latm_mutex_set;
+ threadObtainedLocks_[threadId] = new latm::mutex_set;
    }
 
- thread_latm_mutex_set::iterator currentlyLockedLocksIter = threadCurrentlyLockedLocks_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator currentlyLockedLocksIter = threadCurrentlyLockedLocks_.find(threadId);
    if (threadCurrentlyLockedLocks_.end() == currentlyLockedLocksIter)
    {
- threadCurrentlyLockedLocks_[threadId] = new latm_mutex_set;
+ threadCurrentlyLockedLocks_[threadId] = new latm::mutex_set;
    }
 #endif
 
@@ -311,23 +310,23 @@
    ThreadBoolContainer::iterator blockedIter = threadBlockedLists_.find(threadId);
 #if PERFORMING_LATM
 #if USING_TRANSACTION_SPECIFIC_LATM
- thread_latm_mutex_set::iterator conflictingMutexIter = threadConflictingMutexes_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator conflictingMutexIter = threadConflictingMutexes_.find(threadId);
    if (threadConflictingMutexes_.end() == conflictingMutexIter)
    {
- threadConflictingMutexes_[threadId] = new latm_mutex_set;
+ threadConflictingMutexes_[threadId] = new latm::mutex_set;
    }
 #endif
 
- thread_latm_mutex_set::iterator obtainedLocksIter = threadObtainedLocks_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator obtainedLocksIter = threadObtainedLocks_.find(threadId);
    if (threadObtainedLocks_.end() == obtainedLocksIter)
    {
- threadObtainedLocks_[threadId] = new latm_mutex_set;
+ threadObtainedLocks_[threadId] = new latm::mutex_set;
    }
 
- thread_latm_mutex_set::iterator currentlyLockedLocksIter = threadCurrentlyLockedLocks_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator currentlyLockedLocksIter = threadCurrentlyLockedLocks_.find(threadId);
    if (threadCurrentlyLockedLocks_.end() == currentlyLockedLocksIter)
    {
- threadCurrentlyLockedLocks_[threadId] = new latm_mutex_set;
+ threadCurrentlyLockedLocks_[threadId] = new latm::mutex_set;
    }
 #endif
 
@@ -481,16 +480,16 @@
 
 #if PERFORMING_LATM
 #if USING_TRANSACTION_SPECIFIC_LATM
- thread_latm_mutex_set::iterator conflictingMutexIter = threadConflictingMutexes_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator conflictingMutexIter = threadConflictingMutexes_.find(threadId);
    delete conflictingMutexIter->second;
    threadConflictingMutexes_.erase(conflictingMutexIter);
 #endif
 
- thread_latm_mutex_set::iterator obtainedLocksIter = threadObtainedLocks_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator obtainedLocksIter = threadObtainedLocks_.find(threadId);
    delete obtainedLocksIter->second;
    threadObtainedLocks_.erase(obtainedLocksIter);
 
- thread_latm_mutex_set::iterator currentlyLockedLocksIter = threadCurrentlyLockedLocks_.find(threadId);
+ latm::thread_id_mutex_set_map::iterator currentlyLockedLocksIter = threadCurrentlyLockedLocks_.find(threadId);
    delete currentlyLockedLocksIter->second;
    threadCurrentlyLockedLocks_.erase(currentlyLockedLocksIter);
 #endif

Modified: sandbox/stm/branches/vbe/libs/stm/test/isolatedIntLockInTx.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/isolatedIntLockInTx.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/isolatedIntLockInTx.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -168,7 +168,7 @@
 void TestIsolatedIntLockInTx()
 {
    transaction::initialize();
- transaction::do_full_lock_protection();
+ latm::do_full_lock_protection();
    //transaction::do_direct_updating();
 
    pthread_t *threads = new pthread_t[kMaxThreads];

Modified: sandbox/stm/branches/vbe/libs/stm/test/litExample.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/litExample.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/litExample.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -373,9 +373,9 @@
       SLEEP(10);
    }
 
- if (transaction::doing_full_lock_protection()) cout << "full_";
- else if (transaction::doing_tm_lock_protection()) cout << "tm_";
- else if (transaction::doing_tx_lock_protection()) cout << "tx_";
+ if (latm::instance().doing_full_lock_protection()) cout << "full_";
+ else if (latm::instance().doing_tm_lock_protection()) cout << "tm_";
+ else if (latm::instance().doing_tx_lock_protection()) cout << "tx_";
 
    cout << "run_time\t" << endTimer - startTimer << endl;
 }

Modified: sandbox/stm/branches/vbe/libs/stm/test/lotExample.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/lotExample.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/lotExample.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -379,9 +379,9 @@
       SLEEP(10);
    }
 
- if (transaction::doing_full_lock_protection()) cout << "full_";
- else if (transaction::doing_tm_lock_protection()) cout << "tm_";
- else if (transaction::doing_tx_lock_protection()) cout << "tx_";
+ if (latm::instance().doing_full_lock_protection()) cout << "full_";
+ else if (latm::instance().doing_tm_lock_protection()) cout << "tm_";
+ else if (latm::instance().doing_tx_lock_protection()) cout << "tx_";
 
    cout << "run_time\t" << endTimer - startTimer << endl;
 }

Modified: sandbox/stm/branches/vbe/libs/stm/test/nestedTxs.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/nestedTxs.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/nestedTxs.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -243,8 +243,8 @@
    transaction::initialize();
    transaction::initialize_thread();
 
- //transaction::do_tm_lock_protection();
- transaction::do_tx_lock_protection();
+ //latm::do_tm_lock_protection();
+ latm::do_tx_lock_protection();
 
    //transaction::tm_lock_conflict(&L);
    //transaction::tm_lock_conflict(&L2);

Modified: sandbox/stm/branches/vbe/libs/stm/test/stm.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/stm.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/stm.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -140,9 +140,9 @@
 #if PERFORMING_LATM
 
          std::string latmType = argv[++i];
- if (latmType == "full") transaction::do_full_lock_protection();
- else if (latmType == "tm") transaction::do_tm_lock_protection();
- else if (latmType == "tx") transaction::do_tx_lock_protection();
+ if (latmType == "full") latm::do_full_lock_protection();
+ else if (latmType == "tm") latm::do_tm_lock_protection();
+ else if (latmType == "tx") latm::do_tx_lock_protection();
          else
          {
             cout << "invalid LATM protection type, exiting" << endl;

Modified: sandbox/stm/branches/vbe/libs/stm/test/testHT_latm.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testHT_latm.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testHT_latm.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -270,7 +270,7 @@
       // every 4th thread works on the same linked list that
       // the 3rd thread is working on, so only add that conflict
       //----------------------------------------------------------------
- if (transaction::doing_tm_lock_protection() && 0 == (k+1) % 2)
+ if (latm::instance().doing_tm_lock_protection() && 0 == (k+1) % 2)
       {
          //transaction::add_tm_conflicting_lock(llist[index]->get_list_lock());
          //cout << "TM-lock conflict added: " << index << endl;

Modified: sandbox/stm/branches/vbe/libs/stm/test/testHashMapAndLinkedListsWithLocks.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testHashMapAndLinkedListsWithLocks.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testHashMapAndLinkedListsWithLocks.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -377,7 +377,7 @@
 
    if (runTime < 1) runTime = 1;
 
- cout << "LATM: " << transaction::latm_protection_str() << endl << endl;
+ cout << "LATM: " << latm::instance().protection_str() << endl << endl;
    cout << "HT: DSTM_" << transaction::update_policy_string() << " ";
    cout << "THRD: " << kMaxThreads << " ";
    cout << "SIZE: " << totalInserts << " ";
@@ -427,7 +427,7 @@
    globalLinkedList = new LATM::LinkedList<int>;
    transaction::initialize();
 
- if (transaction::doing_tm_lock_protection())
+ if (latm::instance().doing_tm_lock_protection())
    {
       for (int k = 1; k < kBuckets2; ++k)
       {

Modified: sandbox/stm/branches/vbe/libs/stm/test/testHashMapWithLocks.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testHashMapWithLocks.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testHashMapWithLocks.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -206,10 +206,10 @@
    globalHashMap = new LATM::HashMap<int>;
    transaction::initialize();
 
- transaction::do_full_lock_protection();
+ latm::do_full_lock_protection();
 
 #if 0
- transaction::do_tm_conflicting_lock_protection();
+ latm::instance().do_tm_conflicting_lock_protection();
 
    for (int k = 1; k < kBuckets; ++k)
    {

Modified: sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/testLL_latm.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -270,7 +270,7 @@
       // every 4th thread works on the same linked list that
       // the 3rd thread is working on, so only add that conflict
       //----------------------------------------------------------------
- if (transaction::doing_tm_lock_protection() && 0 == (k+1) % 2)
+ if (latm::instance().doing_tm_lock_protection() && 0 == (k+1) % 2)
       {
          //transaction::add_tm_conflicting_lock(llist[index]->get_list_lock());
          //cout << "TM-lock conflict added: " << index << endl;

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 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -139,11 +139,11 @@
 
       transaction t;
 
- if (transaction::doing_tx_lock_protection())
+ if (latm::instance().doing_tx_lock_protection())
       {
          t.lock_conflict(&list_lock_);
       }
- else if (transaction::doing_tm_lock_protection())
+ else if (latm::instance().doing_tm_lock_protection())
       {
          transaction::tm_lock_conflict(&list_lock_);
       }
@@ -184,7 +184,7 @@
 
       transaction t;
 
- if (eTxConflictingLockLatmProtection == transaction::latm_protection())
+ if (eTxConflictingLockLatmProtection == latm::instance().protection())
       {
          t.add_tx_conflicting_lock(&list_lock_);
       }

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 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -140,7 +140,7 @@
 
       transaction t;
 
- if (eTxConflictingLockLatmProtection == transaction::latm_protection())
+ if (eTxConflictingLockLatmProtection == latm::instance().protection())
       {
          t.add_tx_conflicting_lock(&list_lock_);
       }
@@ -160,7 +160,7 @@
 
       transaction t;
 
- if (eTxConflictingLockLatmProtection == transaction::latm_protection())
+ if (eTxConflictingLockLatmProtection == latm::instance().protection())
       {
          t.add_tx_conflicting_lock(&list_lock_);
       }

Modified: sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.cpp
==============================================================================
--- sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.cpp (original)
+++ sandbox/stm/branches/vbe/libs/stm/test/usingLockTx.cpp 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -398,7 +398,7 @@
    transaction::initialize_thread();
 
    //transaction::do_tm_lock_protection();
- transaction::do_tx_lock_protection();
+ latm::do_tx_lock_protection();
 
    //transaction::tm_lock_conflict(&L);
    //transaction::tm_lock_conflict(&L2);

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 2009-10-25 12:29:15 EDT (Sun, 25 Oct 2009)
@@ -142,7 +142,7 @@
 
       try_atomic(t)
       {
- if (eTxConflictingLockLatmProtection == transaction::latm_protection())
+ if (eTxConflictingLockLatmProtection == latm::instance().protection())
          {
             t.add_tx_conflicting_lock(&list_lock_);
          }
@@ -165,7 +165,7 @@
 
       try_atomic(t)
       {
- if (eTxConflictingLockLatmProtection == transaction::latm_protection())
+ if (eTxConflictingLockLatmProtection == latm::instance().protection())
          {
             t.add_tx_conflicting_lock(&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