summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SessionState.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/SessionState.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/SessionState.cpp')
-rw-r--r--cpp/src/qpid/broker/SessionState.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp
index b64fc20787..7e5f605753 100644
--- a/cpp/src/qpid/broker/SessionState.cpp
+++ b/cpp/src/qpid/broker/SessionState.cpp
@@ -212,11 +212,15 @@ struct ScheduledCreditTask : public TimerTask {
void fire() {
// This is the best we can currently do to avoid a destruction/fire race
if (!isCancelled()) {
- if ( !sessionState.processSendCredit(0) ) {
- QPID_LOG(warning, sessionState.getId() << ": Reschedule sending credit");
- reset();
- timer.add(this);
- }
+ sessionState.getConnection().requestIOProcessing(boost::bind(&ScheduledCreditTask::sendCredit, this));
+ }
+ }
+
+ void sendCredit() {
+ if ( !sessionState.processSendCredit(0) ) {
+ QPID_LOG(warning, sessionState.getId() << ": Reschedule sending credit");
+ reset();
+ timer.add(this);
}
}
};