diff options
| author | Gordon Sim <gsim@apache.org> | 2011-04-12 15:04:00 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2011-04-12 15:04:00 +0000 |
| commit | b6cdda8be4547011db9672a2171084135e8a82c4 (patch) | |
| tree | f3dfb43ee7869e55f855c6138f1bba0d852d7ff3 /cpp/src/qpid/broker/NullMessageStore.cpp | |
| parent | 360aa9aa51b09dfb819912e36bfcef84b5d2a76e (diff) | |
| download | qpid-python-b6cdda8be4547011db9672a2171084135e8a82c4.tar.gz | |
QPID-3201: locking in NullMessageStore to protect set of prepared xids
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1091443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/NullMessageStore.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/NullMessageStore.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/NullMessageStore.cpp b/cpp/src/qpid/broker/NullMessageStore.cpp index dc8615d58b..43f600eaf1 100644 --- a/cpp/src/qpid/broker/NullMessageStore.cpp +++ b/cpp/src/qpid/broker/NullMessageStore.cpp @@ -126,21 +126,25 @@ std::auto_ptr<TPCTransactionContext> NullMessageStore::begin(const std::string& void NullMessageStore::prepare(TPCTransactionContext& ctxt) { + qpid::sys::ScopedLock<qpid::sys::Mutex> l(lock); prepared.insert(DummyCtxt::getXid(ctxt)); } void NullMessageStore::commit(TransactionContext& ctxt) { + qpid::sys::ScopedLock<qpid::sys::Mutex> l(lock); prepared.erase(DummyCtxt::getXid(ctxt)); } void NullMessageStore::abort(TransactionContext& ctxt) { + qpid::sys::ScopedLock<qpid::sys::Mutex> l(lock); prepared.erase(DummyCtxt::getXid(ctxt)); } void NullMessageStore::collectPreparedXids(std::set<std::string>& out) { + qpid::sys::ScopedLock<qpid::sys::Mutex> l(lock); out.insert(prepared.begin(), prepared.end()); } |
