summaryrefslogtreecommitdiff
path: root/cpp/src/qmf/Agent.cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2011-10-21 14:42:12 +0000
committerStephen D. Huston <shuston@apache.org>2011-10-21 14:42:12 +0000
commitf83677056891e436bf5ba99e79240df2a44528cd (patch)
tree625bfd644b948e89105630759cf6decb0435354d /cpp/src/qmf/Agent.cpp
parentebfd9ff053b04ab379acfc0fefedee5a31b6d8a5 (diff)
downloadqpid-python-QPID-2519.tar.gz
Merged out from trunkQPID-2519
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-2519@1187375 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/Agent.cpp')
-rw-r--r--cpp/src/qmf/Agent.cpp29
1 files changed, 6 insertions, 23 deletions
diff --git a/cpp/src/qmf/Agent.cpp b/cpp/src/qmf/Agent.cpp
index 915f2a1c88..684f8e4fba 100644
--- a/cpp/src/qmf/Agent.cpp
+++ b/cpp/src/qmf/Agent.cpp
@@ -72,7 +72,7 @@ Schema Agent::getSchema(const SchemaId& s, Duration t) { return impl->getSchema(
AgentImpl::AgentImpl(const std::string& n, uint32_t e, ConsoleSessionImpl& s) :
name(n), directSubject(n), epoch(e), session(s), touched(true), untouchedCount(0), capability(0),
- sender(session.directSender), nextCorrelator(1), schemaCache(s.schemaCache)
+ sender(session.directSender), schemaCache(s.schemaCache)
{
}
@@ -102,12 +102,11 @@ const Variant& AgentImpl::getAttribute(const string& k) const
ConsoleEvent AgentImpl::query(const Query& query, Duration timeout)
{
boost::shared_ptr<SyncContext> context(new SyncContext());
- uint32_t correlator;
+ uint32_t correlator(session.correlator());
ConsoleEvent result;
{
qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
contextMap[correlator] = context;
}
try {
@@ -151,12 +150,7 @@ ConsoleEvent AgentImpl::query(const string& text, Duration timeout)
uint32_t AgentImpl::queryAsync(const Query& query)
{
- uint32_t correlator;
-
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
- }
+ uint32_t correlator(session.correlator());
sendQuery(query, correlator);
return correlator;
@@ -172,12 +166,11 @@ uint32_t AgentImpl::queryAsync(const string& text)
ConsoleEvent AgentImpl::callMethod(const string& method, const Variant::Map& args, const DataAddr& addr, Duration timeout)
{
boost::shared_ptr<SyncContext> context(new SyncContext());
- uint32_t correlator;
+ uint32_t correlator(session.correlator());
ConsoleEvent result;
{
qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
contextMap[correlator] = context;
}
try {
@@ -213,12 +206,7 @@ ConsoleEvent AgentImpl::callMethod(const string& method, const Variant::Map& arg
uint32_t AgentImpl::callMethodAsync(const string& method, const Variant::Map& args, const DataAddr& addr)
{
- uint32_t correlator;
-
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
- }
+ uint32_t correlator(session.correlator());
sendMethod(method, args, addr, correlator);
return correlator;
@@ -596,12 +584,7 @@ void AgentImpl::sendMethod(const string& method, const Variant::Map& args, const
void AgentImpl::sendSchemaRequest(const SchemaId& id)
{
- uint32_t correlator;
-
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
- }
+ uint32_t correlator(session.correlator());
if (capability >= AGENT_CAPABILITY_V2_SCHEMA) {
Query query(QUERY_SCHEMA, id);