Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62187 - sandbox/stm/boost/stm/detail
From: justin_at_[hidden]
Date: 2010-05-25 00:16:11


Author: jgottschlich
Date: 2010-05-25 00:16:07 EDT (Tue, 25 May 2010)
New Revision: 62187
URL: http://svn.boost.org/trac/boost/changeset/62187

Log:
fixed is_only_reading and other functions.
Text files modified:
   sandbox/stm/boost/stm/detail/transaction_impl.hpp | 16 +++++++++-------
   1 files changed, 9 insertions(+), 7 deletions(-)

Modified: sandbox/stm/boost/stm/detail/transaction_impl.hpp
==============================================================================
--- sandbox/stm/boost/stm/detail/transaction_impl.hpp (original)
+++ sandbox/stm/boost/stm/detail/transaction_impl.hpp 2010-05-25 00:16:07 EDT (Tue, 25 May 2010)
@@ -512,7 +512,7 @@
    auto_general_lock_.release_lock();
     //transactionMutexLocker_.unlock();
 
- if (direct_updating()) doIntervalDeletions();
+ doIntervalDeletions();
 #if PERFORMING_LATM
    while (blocked()) { SLEEP(10) ; }
 #endif
@@ -1322,7 +1322,7 @@
    wbloom().clear();
 #endif
 
- if (!alreadyRemovedFromInFlight)
+ // (some error exists with this optimization) if (!alreadyRemovedFromInFlight)
    {
       lock_inflight_access();
       // if I'm the last transaction of this thread, reset abort to false
@@ -1915,13 +1915,15 @@
 //----------------------------------------------------------------------------
 inline void boost::stm::transaction::deferredCommitTransactionDeletedMemory() throw()
 {
- for (MemoryContainerList::iterator i = deletedMemoryList().begin();
- i != deletedMemoryList().end(); ++i)
+ using namespace boost::stm;
+
+ if (!deletedMemoryList().empty())
    {
- delete *i;
+ var_auto_lock<PLOCK> a(&deletionBufferMutex_, NULL);
+ deletionBuffer_.insert( std::pair<size_t, MemoryContainerList>
+ (time(NULL), deletedMemoryList()) );
+ deletedMemoryList().clear();
    }
-
- deletedMemoryList().clear();
 }
 
 ////////////////////////////////////////////////////////////////////////////


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