diff options
Diffstat (limited to 'qpid/cpp/src/qpid/broker/QueueRegistry.cpp')
-rw-r--r-- | qpid/cpp/src/qpid/broker/QueueRegistry.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp index 2101d51fc2..c3cd3488e8 100644 --- a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp +++ b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp @@ -101,6 +101,13 @@ void QueueRegistry::destroy( eraseLH(i, q, name, connectionId, userId); } } + // Destroy management object, store record etc. The Queue will not + // actually be deleted till all shared_ptr to it are gone. + // + // Outside the lock (avoid deadlock) but guaranteed to be called exactly once, + // since q will only be set on the first call to destroy above. + if (q) + q->destroyed(); } void QueueRegistry::eraseLH(QueueMap::iterator i, Queue::shared_ptr q, const string& name, const string& connectionId, const string& userId) @@ -129,11 +136,17 @@ bool QueueRegistry::destroyIfUntouched(const string& name, long version, q = i->second; if (q->version == version) { eraseLH(i, q, name, connectionId, userId); - return true; } } - return false; } + // Destroy management object, store record etc. The Queue will not + // actually be deleted till all shared_ptr to it are gone. + // + // Outside the lock (avoid deadlock) but guaranteed to be called exactly once, + // since q will only be set on the first call to destroy above. + if (q) + q->destroyed(); + return q; } Queue::shared_ptr QueueRegistry::find(const string& name){ |