summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevents.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-05-22 09:30:04 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-05-22 09:30:04 -0400
commiteb81d5f23fc725f53857d7a62923e273a057c455 (patch)
tree5c1ba76e722d9630fa597023a1e6c196a04f758c /indra/llcommon/llevents.cpp
parentf8ccb39b8d944f9d2bf4308f909273cd5a35cbe7 (diff)
parent47985e5822ce9fdebb7443e13b3c1a781a842ecd (diff)
Merge remote-tracking branch 'DRTVWR-600-maint-A' into nat/kwds
Diffstat (limited to 'indra/llcommon/llevents.cpp')
-rw-r--r--indra/llcommon/llevents.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index 1a305ec3dc..70931f3a65 100644
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -211,12 +211,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();
}
}
@@ -373,9 +382,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();
}
@@ -383,6 +394,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)
@@ -407,6 +419,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
@@ -566,8 +580,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())
{
@@ -579,6 +594,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())
{