diff options
| author | Ted Ross <tross@apache.org> | 2008-06-30 19:00:49 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2008-06-30 19:00:49 +0000 |
| commit | 5a848a6a699d5ab8de93a646a44614378e56871f (patch) | |
| tree | e2a15b5ad2dd1a30e206601dc8f6902ea875f2e7 /cpp/src/qpid/broker/Link.cpp | |
| parent | 258cccda74ffaa478366bfacda07e61bd88b20ec (diff) | |
| download | qpid-python-5a848a6a699d5ab8de93a646a44614378e56871f.tar.gz | |
QPID-1160 - Per-thread counters in management API to avoid locking
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@672864 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Link.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Link.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp index 630ce68150..87c0020dcb 100644 --- a/cpp/src/qpid/broker/Link.cpp +++ b/cpp/src/qpid/broker/Link.cpp @@ -63,7 +63,7 @@ Link::Link(LinkRegistry* _links, if (agent.get() != 0) { mgmtObject = management::Link::shared_ptr - (new management::Link(this, parent, _host, _port, _useSsl, _durable)); + (new management::Link(agent.get(), this, parent, _host, _port, _useSsl, _durable)); if (!durable) agent->addObject(mgmtObject); } @@ -109,7 +109,8 @@ void Link::startConnectionLH () boost::bind (&Link::closed, this, _1, _2)); } catch(std::exception& e) { setStateLH(STATE_WAITING); - mgmtObject->set_lastError (e.what()); + if (mgmtObject.get() != 0) + mgmtObject->set_lastError (e.what()); } } @@ -141,7 +142,8 @@ void Link::closed (int, std::string text) if (state != STATE_FAILED) { setStateLH(STATE_WAITING); - mgmtObject->set_lastError (text); + if (mgmtObject.get() != 0) + mgmtObject->set_lastError (text); } if (closing) @@ -257,7 +259,8 @@ void Link::notifyConnectionForced(const string text) Mutex::ScopedLock mutex(lock); setStateLH(STATE_FAILED); - mgmtObject->set_lastError(text); + if (mgmtObject.get() != 0) + mgmtObject->set_lastError(text); } void Link::setPersistenceId(uint64_t id) const |
