diff options
author | Alan Conway <aconway@apache.org> | 2007-11-28 17:13:28 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-11-28 17:13:28 +0000 |
commit | 2b1b179702863e8e6d077c025f5244eaa461a990 (patch) | |
tree | 723d5b63eaa9d211ef2e119ec612bc8ad59cbf07 /cpp/src/qpid/broker/DtxManager.cpp | |
parent | 4c3d7def3ec41f44744d8f96e5229022b326b4fa (diff) | |
download | qpid-python-2b1b179702863e8e6d077c025f5244eaa461a990.tar.gz |
Fixed to build with boost 1.34 as well as boost 1.33
- boost::ptr_map API changed.
- Boost.Test unit test framework changes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@599067 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/DtxManager.cpp')
-rw-r--r-- | cpp/src/qpid/broker/DtxManager.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/cpp/src/qpid/broker/DtxManager.cpp b/cpp/src/qpid/broker/DtxManager.cpp index 7ac89d3a4e..1d8b64eb5b 100644 --- a/cpp/src/qpid/broker/DtxManager.cpp +++ b/cpp/src/qpid/broker/DtxManager.cpp @@ -22,10 +22,13 @@ #include "DtxTimeout.h" #include "qpid/framing/reply_exceptions.h" #include "qpid/log/Statement.h" +#include "qpid/ptr_map.h" + #include <boost/format.hpp> #include <iostream> -using qpid::sys::Mutex; +using qpid::sys::Mutex; +using namespace qpid::ptr_map; using namespace qpid::broker; using namespace qpid::framing; @@ -81,14 +84,14 @@ void DtxManager::rollback(const std::string& xid) } } -DtxManager::WorkMap::iterator DtxManager::getWork(const std::string& xid) +DtxWorkRecord* DtxManager::getWork(const std::string& xid) { Mutex::ScopedLock locker(lock); WorkMap::iterator i = work.find(xid); if (i == work.end()) { throw InvalidArgumentException(QPID_MSG("Unrecognised xid " << xid)); } - return i; + return get_pointer(i); } void DtxManager::remove(const std::string& xid) @@ -102,20 +105,20 @@ void DtxManager::remove(const std::string& xid) } } -DtxManager::WorkMap::iterator DtxManager::createWork(std::string xid) +DtxWorkRecord* DtxManager::createWork(std::string xid) { Mutex::ScopedLock locker(lock); WorkMap::iterator i = work.find(xid); if (i != work.end()) { throw CommandInvalidException(QPID_MSG("Xid " << xid << " is already known (use 'join' to add work to an existing xid)")); } else { - return work.insert(xid, new DtxWorkRecord(xid, store)).first; + return get_pointer(work.insert(xid, new DtxWorkRecord(xid, store)).first); } } void DtxManager::setTimeout(const std::string& xid, uint32_t secs) { - WorkMap::iterator record = getWork(xid); + DtxWorkRecord* record = getWork(xid); DtxTimeout::shared_ptr timeout = record->getTimeout(); if (timeout.get()) { if (timeout->timeout == secs) return;//no need to do anything further if timeout hasn't changed @@ -140,7 +143,7 @@ void DtxManager::timedout(const std::string& xid) if (i == work.end()) { QPID_LOG(warning, "Transaction timeout failed: no record for xid"); } else { - i->timedout(); + get_pointer(i)->timedout(); //TODO: do we want to have a timed task to cleanup, or can we rely on an explicit completion? //timer.add(TimerTask::shared_ptr(new DtxCleanup(60*30/*30 mins*/, *this, xid))); } |