|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52671 - sandbox/stm/boost/stm
From: justin_at_[hidden]
Date: 2009-04-29 22:15:28
Author: jgottschlich
Date: 2009-04-29 22:15:27 EDT (Wed, 29 Apr 2009)
New Revision: 52671
URL: http://svn.boost.org/trac/boost/changeset/52671
Log:
extended get_written() for direct update.
Text files modified:
sandbox/stm/boost/stm/transaction.hpp | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
Modified: sandbox/stm/boost/stm/transaction.hpp
==============================================================================
--- sandbox/stm/boost/stm/transaction.hpp (original)
+++ sandbox/stm/boost/stm/transaction.hpp 2009-04-29 22:15:27 EDT (Wed, 29 Apr 2009)
@@ -471,10 +471,18 @@
template <typename T>
T* get_written(T const & in)
{
- WriteContainer::iterator i = writeList().find
- ((base_transaction_object*)(&in));
- if (i == writeList().end()) return NULL;
- else return static_cast<T*>(i->second);
+ if (directUpdating_)
+ {
+ if (in.transaction_thread() == threadId_) return (T*)(&in);
+ else return NULL;
+ }
+ else
+ {
+ WriteContainer::iterator i = writeList().find
+ ((base_transaction_object*)(&in));
+ if (i == writeList().end()) return NULL;
+ else return static_cast<T*>(i->second);
+ }
}
//--------------------------------------------------------------------------
@@ -1375,6 +1383,7 @@
#include <boost/stm/detail/transaction_impl.hpp>
#include <boost/stm/detail/latm_general_impl.hpp>
#include <boost/stm/detail/auto_lock.hpp>
+#include <boost/stm/detail/tx_ptr.hpp>
///////////////////////////////////////////////////////////////////////////////
#endif // TRANSACTION_H
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