diff options
Diffstat (limited to 'cpp/src/qpid/broker/DtxWorkRecord.cpp')
-rw-r--r-- | cpp/src/qpid/broker/DtxWorkRecord.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/cpp/src/qpid/broker/DtxWorkRecord.cpp b/cpp/src/qpid/broker/DtxWorkRecord.cpp index 924f953eb8..13eaf4e568 100644 --- a/cpp/src/qpid/broker/DtxWorkRecord.cpp +++ b/cpp/src/qpid/broker/DtxWorkRecord.cpp @@ -20,7 +20,10 @@ */ #include "qpid/broker/DtxWorkRecord.h" #include "qpid/broker/DtxManager.h" +#include "qpid/broker/DtxTimeout.h" #include "qpid/framing/reply_exceptions.h" +#include "qpid/sys/Timer.h" + #include <boost/format.hpp> #include <boost/mem_fn.hpp> using boost::mem_fn; @@ -39,6 +42,12 @@ DtxWorkRecord::~DtxWorkRecord() } } +void DtxWorkRecord::setTimeout(boost::intrusive_ptr<DtxTimeout> t) +{ timeout = t; } + +boost::intrusive_ptr<DtxTimeout> DtxWorkRecord::getTimeout() +{ return timeout; } + bool DtxWorkRecord::prepare() { Mutex::ScopedLock locker(lock); @@ -182,17 +191,3 @@ void DtxWorkRecord::timedout() } abort(); } - -size_t DtxWorkRecord::indexOf(const DtxBuffer::shared_ptr& buf) { - Work::iterator i = std::find(work.begin(), work.end(), buf); - if (i == work.end()) throw NotFoundException( - QPID_MSG("Can't find DTX buffer for xid: " << buf->getXid())); - return i - work.begin(); -} - -DtxBuffer::shared_ptr DtxWorkRecord::operator[](size_t i) const { - if (i > work.size()) - throw NotFoundException( - QPID_MSG("Can't find DTX buffer " << i << " for xid: " << xid)); - return work[i]; -} |