diff options
Diffstat (limited to 'indra/llcommon/llevents.cpp')
-rw-r--r-- | indra/llcommon/llevents.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 0a213bddef..aa9a258723 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -152,12 +152,21 @@ void LLEventPumps::clear() } } -void LLEventPumps::reset() +void LLEventPumps::reset(bool log_pumps) { // Reset every known LLEventPump instance. Leave it up to each instance to // decide what to do with the reset() call. + if (log_pumps) + { + LL_INFOS() << "Resetting " << (S32)mPumpMap.size() << " pumps" << LL_ENDL; + } + for (PumpMap::value_type& pair : mPumpMap) { + if (log_pumps) + { + LL_INFOS() << "Resetting pump " << pair.first << LL_ENDL; + } pair.second->reset(); } } @@ -314,9 +323,11 @@ std::string LLEventPump::inventName(const std::string& pfx) void LLEventPump::clear() { + LLMutexLock lock(&mConnectionListMutex); // Destroy the original LLStandardSignal instance, replacing it with a // whole new one. mSignal = std::make_shared<LLStandardSignal>(); + mConnections.clear(); } @@ -324,6 +335,7 @@ void LLEventPump::reset() { // Resetting mSignal is supposed to disconnect everything on its own // But due to crash on 'reset' added explicit cleanup to get more data + LLMutexLock lock(&mConnectionListMutex); ConnectionMap::const_iterator iter = mConnections.begin(); ConnectionMap::const_iterator end = mConnections.end(); while (iter!=end) @@ -348,6 +360,8 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL return LLBoundListener(); } + LLMutexLock lock(&mConnectionListMutex); + float nodePosition = 1.0; // if the supplied name is empty we are not interested in the ordering mechanism @@ -507,8 +521,9 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL return bound; } -LLBoundListener LLEventPump::getListener(const std::string& name) const +LLBoundListener LLEventPump::getListener(const std::string& name) { + LLMutexLock lock(&mConnectionListMutex); ConnectionMap::const_iterator found = mConnections.find(name); if (found != mConnections.end()) { @@ -520,6 +535,7 @@ LLBoundListener LLEventPump::getListener(const std::string& name) const void LLEventPump::stopListening(const std::string& name) { + LLMutexLock lock(&mConnectionListMutex); ConnectionMap::iterator found = mConnections.find(name); if (found != mConnections.end()) { |