<feed xmlns='http://www.w3.org/2005/Atom'>
<title>viewer.git/indra/llcommon/llevents.cpp, branch cef_147</title>
<subtitle>Megapahit's fork of the Second Life viewer.
</subtitle>
<id>https://www.megapahit.org/viewer.git/atom?h=cef_147</id>
<link rel='self' href='https://www.megapahit.org/viewer.git/atom?h=cef_147'/>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/'/>
<updated>2025-12-01T10:46:57Z</updated>
<entry>
<title>#5078 Replace boost::function with std::function</title>
<updated>2025-12-01T10:46:57Z</updated>
<author>
<name>Rye</name>
<email>rye@alchemyviewer.org</email>
</author>
<published>2025-12-01T10:46:57Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=fb3f0e18a2ada57f98c3b10fab0c13fb2d504ae1'/>
<id>urn:sha1:fb3f0e18a2ada57f98c3b10fab0c13fb2d504ae1</id>
<content type='text'>
* Replace boost::function usage with std::function for easier debugging and reduced compiler warnings
* Remove a few remaining instances of boost::noncopyable that were missed in tests

Signed-off-by: Rye &lt;rye@alchemyviewer.org&gt;</content>
</entry>
<entry>
<title>Fix whitespace pre-commit hook failures</title>
<updated>2024-06-12T20:51:21Z</updated>
<author>
<name>Brad Linden</name>
<email>brad@lindenlab.com</email>
</author>
<published>2024-06-12T20:51:21Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=8444cd9562a6a7b755fcb075864e205122354192'/>
<id>urn:sha1:8444cd9562a6a7b755fcb075864e205122354192</id>
<content type='text'>
</content>
</entry>
<entry>
<title>#1354 Make coroutines use LLCoros::Mutex instead of LLMutex (#1356)</title>
<updated>2024-05-02T15:57:39Z</updated>
<author>
<name>RunitaiLinden</name>
<email>davep@lindenlab.com</email>
</author>
<published>2024-05-02T15:57:39Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=7fc5f7e649c564fa8479a72a45459d0cc427d0f8'/>
<id>urn:sha1:7fc5f7e649c564fa8479a72a45459d0cc427d0f8</id>
<content type='text'>
* #1354 Make coroutines use LLCoros::Mutex instead of LLMutex

* #1354 Fix some more unsafe coroutine executions.

* #1354 Implement changes requested by Nat</content>
</entry>
<entry>
<title>Merge branch 'main' into DRTVWR-594-maint-Y</title>
<updated>2023-12-18T04:33:57Z</updated>
<author>
<name>Andrey Lihatskiy</name>
<email>alihatskiy@productengine.com</email>
</author>
<published>2023-12-18T04:33:57Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=aed6313d7c755ae1b980074fc27dfd98267fca24'/>
<id>urn:sha1:aed6313d7c755ae1b980074fc27dfd98267fca24</id>
<content type='text'>
</content>
</entry>
<entry>
<title>SL-17434 Crash clearing LLEventPumps</title>
<updated>2023-11-23T15:57:19Z</updated>
<author>
<name>Andrey Kleshchev</name>
<email>andreykproductengine@lindenlab.com</email>
</author>
<published>2023-11-22T22:57:46Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=a1fed466f0cc0c08d3cdcba88e02230c94e763b0'/>
<id>urn:sha1:a1fed466f0cc0c08d3cdcba88e02230c94e763b0</id>
<content type='text'>
We actively use event pumps's connections in threads, make sure nothing
modifies list of connections during reset.
And in case this doesn't fix the issue list affected pump before it
crashes to have a better idea of what is going on.
</content>
</entry>
<entry>
<title>DRTVWR-564: WIP: Add LazyEventAPI and tests. Tests don't yet pass.</title>
<updated>2022-06-18T15:57:10Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2022-06-18T15:57:10Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=af4fbc1f8a99a3c5370cb6db45435e67f9ce92d2'/>
<id>urn:sha1:af4fbc1f8a99a3c5370cb6db45435e67f9ce92d2</id>
<content type='text'>
LazyEventAPI is a registrar that implicitly instantiates some particular
LLEventAPI subclass on demand: that is, when LLEventPumps::obtain() tries to
find an LLEventPump by the registered name.

This leverages the new LLEventPumps::registerPumpFactory() machinery. Fix
registerPumpFactory() to adapt the passed PumpFactory to accept TypeFactory
parameters (two of which it ignores). Supplement it with
unregisterPumpFactory() to support LazyEventAPI instances with lifespans
shorter than the process -- which may be mostly test programs, but still a
hole worth closing. Similarly, add unregisterTypeFactory().

A LazyEventAPI subclass takes over responsibility for specifying the
LLEventAPI's name, desc, field, plus whatever add() calls will be needed to
register the LLEventAPI's operations. This is so we can (later) enhance
LLLeapListener to consult LazyEventAPI instances for not-yet-instantiated
LLEventAPI metadata, as well as enumerating existing LLEventAPI instances.

The trickiest part of this is capturing calls to the various
LLEventDispatcher::add() overloads in such a way that, when the LLEventAPI
subclass is eventually instantiated, we can replay them in the new instance.

LLEventAPI acquires a new protected constructor specifically for use by a
subclass registered by a companion LazyEventAPI. It accepts a const reference
to LazyEventAPIParams, intended to be opaque to the LLEventAPI subclass; the
subclass must declare a constructor that accepts and forwards the parameter
block to the new LLEventAPI constructor. The implementation delegates to the
existing LLEventAPI constructor, plus it runs deferred add() calls.

LLDispatchListener now derives from LLEventStream instead of containing it as
a data member. The reason is that if LLEventPumps::obtain() implicitly
instantiates it, LLEventPumps's destructor will try to destroy it by deleting
the LLEventPump*. If the LLEventPump returned by the factory function is a
data member of an outer class, that won't work so well. But if
LLDispatchListener (and by implication, LLEventAPI and any subclass) is
derived from LLEventPump, then the virtual destructor will Do The Right Thing.

Change LLDispatchListener to *not* allow tweaking the LLEventPump name. Since
the overwhelming use case for LLDispatchListener is LLEventAPI, accepting but
silently renaming an LLEventAPI subclass would ensure nobody could reach it.

Change LLEventDispatcher's use of std::enable_if to control the set of add()
overloads available for the intended use cases. Apparently this formulation is
just as functional at the method declaration point, while avoiding the need to
restate the whole enable_if expression at the method definition point.

Add lazyeventapi_test.cpp to exercise.
</content>
</entry>
<entry>
<title>DRTVWR-564: WIP: add LLEventPumps::registerPumpFactory()</title>
<updated>2022-06-15T23:43:53Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2022-06-15T23:43:53Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=a4ff9caf69cb8fbbf3e5d40a258ec99a070b0f94'/>
<id>urn:sha1:a4ff9caf69cb8fbbf3e5d40a258ec99a070b0f94</id>
<content type='text'>
and registerTypeFactory().

Untested.

This will support registering just-in-time LLEventAPI instances, instantiated
on demand.
</content>
</entry>
<entry>
<title>SL-15093 Crash nanov2_free_to_block</title>
<updated>2021-05-28T16:54:16Z</updated>
<author>
<name>Andrey Kleshchev</name>
<email>andreykproductengine@lindenlab.com</email>
</author>
<published>2021-05-28T16:52:07Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=efdbaa50be7ec7ccb3359203acef30f4d15c5c19'/>
<id>urn:sha1:efdbaa50be7ec7ccb3359203acef30f4d15c5c19</id>
<content type='text'>
Superficially crash happens in disconnect() inside signal's deconstructor. Manual cleanup should help figuring out if crash happens due to named or anonymous listeners
</content>
</entry>
<entry>
<title>DRTVWR-476: Make ~LLEventPumps() call reset() on its way out.</title>
<updated>2020-03-25T23:00:10Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-10-22T20:27:59Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=aea1e469820d276d0bc077fb8b3a77a5e6a35faf'/>
<id>urn:sha1:aea1e469820d276d0bc077fb8b3a77a5e6a35faf</id>
<content type='text'>
~LLEventPumps() deletes every LLEventPump instance it created itself. However,
many classes themselves contain LLEventPump subclass instances. These are
registered with LLEventPumps without it managing their lifespan.

But LLEventPump::reset() frees the LLStandardSignal aka
boost::signals2::signal instance owned by the LLEventPump, perforce
disconnecting all current listeners and disabling the LLEventPump. Even though
the instance still exists, if someone subsequently calls post(), nothing will
happen -- which is better than control trying to reach a method of a deleted
object.
</content>
</entry>
<entry>
<title>DRTVWR-476: Eliminate static LLEventPump factory maps.</title>
<updated>2020-03-25T22:58:16Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-10-18T18:46:05Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=95a218fcc0d22cdf02a7c81c555b9c909e24bd40'/>
<id>urn:sha1:95a218fcc0d22cdf02a7c81c555b9c909e24bd40</id>
<content type='text'>
Having a map from std::string to a factory function returning LLEventPump* is
a cool idea, especially since you could statically populate such a map with
string literals and little lambdas.

Unfortunately, static initialization of any data is a bad idea when control
can reach consuming code before that module's static data are constructed.

Since LLEventPumps is already an LLSingleton, it's simple enough to make its
map non-static and initialize it in the constructor.

But another recent static factory-function map was introduced in
llleaplistener.cpp to support the LLLeapListener::newpump() operation. That
involves no LLSingletons.

Introduce LLEventPumps::make(name, tweak, type) to instantiate an LLEventPump
subclass of the specified type with specified (name, tweak) parameters.
Instances returned by make() are owned by LLEventPumps, as with obtain().
Introduce LLEventPumps::BadType exception for when the type string isn't
recognized.

LLEventPumps::obtain() can then simply call make() when the specified instance
name doesn't already exist. The configuration data used internally by obtain()
becomes { string instance name, string subclass name }. Although this too is
currently initialized in the LLEventPumps constructor, migrating it to a
configuration file would now be far more straightforward than before.

LLLeapListener::newpump(), too, can call LLEventPumps::make() with the
caller-specified type string. This eliminates that static factory map.
newpump() must catch BadType and report the error back to its invoker.

Given that the LLEventPump subclass instances returned by make() are owned by
LLEventPumps rather than LLLeapListener, there is no further need for the
LLLeapListener::mEventPumps ptr_map, which was used only to manage lifetime.
Also remove LLLeapListener's "killpump" operation since LLEventPumps provides
no corresponding functionality.
</content>
</entry>
</feed>
