summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Connection.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-02-24 22:38:08 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-02-24 22:38:08 +0000
commit06f943c08fd1f4df7e2de9e2ec13856836492a4e (patch)
tree295561ed447ea79545de3df8d05c3c4d0daef56f /cpp/src/qpid/broker/Connection.cpp
parent74fad234873bfb83831ee221ca38a45e8eb94cc8 (diff)
downloadqpid-python-06f943c08fd1f4df7e2de9e2ec13856836492a4e.tar.gz
Changed the producer rate limit timer callback
so that it generates a callback serialised with the connection git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@747587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Connection.cpp')
-rw-r--r--cpp/src/qpid/broker/Connection.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp
index b7446a2220..b06e06d353 100644
--- a/cpp/src/qpid/broker/Connection.cpp
+++ b/cpp/src/qpid/broker/Connection.cpp
@@ -80,7 +80,8 @@ Connection::Connection(ConnectionOutputHandler* out_, Broker& broker_, const std
void Connection::requestIOProcessing(boost::function0<void> callback)
{
- ioCallback = callback;
+ ScopedLock<Mutex> l(ioCallbackLock);
+ ioCallbacks.push(callback);
out.activateOutput();
}
@@ -221,10 +222,13 @@ bool Connection::hasOutput() { return outputTasks.hasOutput(); }
bool Connection::doOutput() {
try{
- if (ioCallback)
- ioCallback(); // Lend the IO thread for management processing
- ioCallback = 0;
-
+ {
+ ScopedLock<Mutex> l(ioCallbackLock);
+ while (!ioCallbacks.empty()) {
+ ioCallbacks.front()(); // Lend the IO thread for management processing
+ ioCallbacks.pop();
+ }
+ }
if (mgmtClosing)
close(connection::CLOSE_CODE_CONNECTION_FORCED, "Closed by Management Request");
else