diff options
| author | Gordon Sim <gsim@apache.org> | 2008-09-09 17:15:17 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-09-09 17:15:17 +0000 |
| commit | 62dbd3afff76a6da41cd9e1aee8ce11518f22fca (patch) | |
| tree | c15b11bcd62cdb011ff0826dbf2c5e23530fd255 /cpp/src/qpid/broker/SessionState.cpp | |
| parent | 833cf68a5bf58e882f377d144768ceb546e5e036 (diff) | |
| download | qpid-python-62dbd3afff76a6da41cd9e1aee8ce11518f22fca.tar.gz | |
QPID-1261: initial fix (this degrades performance for shared queues with more than one consumer; I'll work on fixing that asap). This also moves the lock refered to in QQPID-1265 which I will update accordingly.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@693518 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionState.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SessionState.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp index aa6f6b7520..42f6b78521 100644 --- a/cpp/src/qpid/broker/SessionState.cpp +++ b/cpp/src/qpid/broker/SessionState.cpp @@ -92,9 +92,8 @@ bool SessionState::isLocal(const ConnectionToken* t) const } void SessionState::detach() { - // activateOutput can be called in a different thread, lock to protect attached status - Mutex::ScopedLock l(lock); QPID_LOG(debug, getId() << ": detached on broker."); + semanticState.detached();//prevents further activateOutput calls until reattached getConnection().outputTasks.removeOutputTask(&semanticState); handler = 0; if (mgmtObject != 0) @@ -102,8 +101,6 @@ void SessionState::detach() { } void SessionState::attach(SessionHandler& h) { - // activateOutput can be called in a different thread, lock to protect attached status - Mutex::ScopedLock l(lock); QPID_LOG(debug, getId() << ": attached on broker."); handler = &h; if (mgmtObject != 0) @@ -115,8 +112,6 @@ void SessionState::attach(SessionHandler& h) { } void SessionState::activateOutput() { - // activateOutput can be called in a different thread, lock to protect attached status - Mutex::ScopedLock l(lock); if (isAttached()) getConnection().outputTasks.activateOutput(); } @@ -273,6 +268,7 @@ void SessionState::senderCompleted(const SequenceSet& commands) { void SessionState::readyToSend() { QPID_LOG(debug, getId() << ": ready to send, activating output."); assert(handler); + semanticState.attached(); sys::AggregateOutput& tasks = handler->getConnection().outputTasks; tasks.addOutputTask(&semanticState); tasks.activateOutput(); |
