<feed xmlns='http://www.w3.org/2005/Atom'>
<title>viewer.git/indra/llcommon/lleventcoro.h, branch 26.4</title>
<subtitle>Megapahit's fork of the Second Life viewer.
</subtitle>
<id>https://megapahit.org/viewer.git/atom?h=26.4</id>
<link rel='self' href='https://megapahit.org/viewer.git/atom?h=26.4'/>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/'/>
<updated>2026-01-24T16:42:55Z</updated>
<entry>
<title>#5046 Fix a long freeze when fetching inventory</title>
<updated>2026-01-24T16:42:55Z</updated>
<author>
<name>Andrey Kleshchev</name>
<email>117672381+akleshchev@users.noreply.github.com</email>
</author>
<published>2026-01-23T20:51:27Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=e42ec63bfd7ada1087a00ca3ccc39c95679b7fab'/>
<id>urn:sha1:e42ec63bfd7ada1087a00ca3ccc39c95679b7fab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed</title>
<updated>2024-04-29T04:56:09Z</updated>
<author>
<name>Andrey Lihatskiy</name>
<email>alihatskiy@productengine.com</email>
</author>
<published>2024-04-29T04:43:28Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=1b68f71348ecf3983b76b40d7940da8377f049b7'/>
<id>urn:sha1:1b68f71348ecf3983b76b40d7940da8377f049b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>SL-793: Use Boost.Fiber instead of the "dcoroutine" library.</title>
<updated>2020-03-25T21:32:45Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2018-05-11T01:46:07Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=66981fab0b3c8dcc3a031d50710a2b24ec6b0603'/>
<id>urn:sha1:66981fab0b3c8dcc3a031d50710a2b24ec6b0603</id>
<content type='text'>
Longtime fans will remember that the "dcoroutine" library is a Google Summer
of Code project by Giovanni P. Deretta. He originally called it
"Boost.Coroutine," and we originally added it to our 3p-boost autobuild
package as such. But when the official Boost.Coroutine library came along
(with a very different API), and we still needed the API of the GSoC project,
we renamed the unofficial one "dcoroutine" to allow coexistence.

The "dcoroutine" library had an internal low-level API more or less analogous
to Boost.Context. We later introduced an implementation of that internal API
based on Boost.Context, a step towards eliminating the GSoC code in favor of
official, supported Boost code.

However, recent versions of Boost.Context no longer support the API on which
we built the shim for "dcoroutine." We started down the path of reimplementing
that shim using the current Boost.Context API -- then realized that it's time
to bite the bullet and replace the "dcoroutine" API with the Boost.Fiber API,
which we've been itching to do for literally years now.

Naturally, most of the heavy lifting is in llcoros.{h,cpp} and
lleventcoro.{h,cpp} -- which is good: the LLCoros layer abstracts away most of
the differences between "dcoroutine" and Boost.Fiber.

The one feature Boost.Fiber does not provide is the ability to forcibly
terminate some other fiber. Accordingly, disable LLCoros::kill() and
LLCoprocedureManager::shutdown(). The only known shutdown() call was in
LLCoprocedurePool's destructor.

We also took the opportunity to remove postAndSuspend2() and its associated
machinery: FutureListener2, LLErrorEvent, errorException(), errorLog(),
LLCoroEventPumps. All that dual-LLEventPump stuff was introduced at a time
when the Responder pattern was king, and we assumed we'd want to listen on one
LLEventPump with the success handler and on another with the error handler. We
have never actually used that in practice. Remove associated tests, of course.

There is one other semantic difference that necessitates patching a number of
tests: with "dcoroutine," fulfilling a future IMMEDIATELY resumes the waiting
coroutine. With Boost.Fiber, fulfilling a future merely marks the fiber as
ready to resume next time the scheduler gets around to it. To observe the test
side effects, we've inserted a number of llcoro::suspend() calls -- also in
the main loop.

For a long time we retained a single unit test exercising the raw "dcoroutine"
API. Remove that.

Eliminate llcoro_get_id.{h,cpp}, which provided llcoro::get_id(), which was a
hack to emulate fiber-local variables. Since Boost.Fiber has an actual API for
that, remove the hack.

In fact, use (new alias) LLCoros::local_ptr for LLSingleton's dependency
tracking in place of llcoro::get_id().

In CMake land, replace BOOST_COROUTINE_LIBRARY with BOOST_FIBER_LIBRARY. We
don't actually use the Boost.Coroutine for anything (though there exist
plausible use cases).
</content>
</entry>
<entry>
<title>MAINT-5011: Introduce LLException base class for viewer exceptions.</title>
<updated>2016-07-19T20:25:25Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2016-07-19T20:25:25Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=9c49a6c91dd9b5bbe811fcd91d8992ed6bac33e7'/>
<id>urn:sha1:9c49a6c91dd9b5bbe811fcd91d8992ed6bac33e7</id>
<content type='text'>
This also introduces LLContinueError for exceptions which should interrupt
some part of viewer processing (e.g. the current coroutine) but should attempt
to let the viewer session proceed.

Derive all existing viewer exception classes from LLException rather than from
std::runtime_error or std::logic_error.

Use BOOST_THROW_EXCEPTION() rather than plain 'throw' to enrich the thrown
exception with source file, line number and containing function.
</content>
</entry>
<entry>
<title>merge 4.0.4-release and MAINT-5974</title>
<updated>2016-05-06T14:28:42Z</updated>
<author>
<name>Oz Linden</name>
<email>oz@lindenlab.com</email>
</author>
<published>2016-05-06T14:28:42Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=950c41d184b340a7a3370c2cbda5d1eed9a17b0b'/>
<id>urn:sha1:950c41d184b340a7a3370c2cbda5d1eed9a17b0b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>MAINT-6336: Put the timeout upstream of the suspending pump and fire the timeout it. Also some cleanup on LLSD construction in vivox.</title>
<updated>2016-04-26T18:56:25Z</updated>
<author>
<name>Rider Linden</name>
<email>rider@lindenlab.com</email>
</author>
<published>2016-04-26T18:56:25Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=dd2311b993d137c538ca57b4360669db6d7fbfa0'/>
<id>urn:sha1:dd2311b993d137c538ca57b4360669db6d7fbfa0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>MAINT-6336: Centralize waiting on event pump with a timeout. Shorten the lifespan of a timeout event pump lifespan to be no longer than necessary. Change all references to the LLEventTimer to instead uses the centralized version.</title>
<updated>2016-04-22T19:07:27Z</updated>
<author>
<name>Rider Linden</name>
<email>rider@lindenlab.com</email>
</author>
<published>2016-04-22T19:07:27Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=899489ae0a4bc4eb187e7813e338b937384a1866'/>
<id>urn:sha1:899489ae0a4bc4eb187e7813e338b937384a1866</id>
<content type='text'>
</content>
</entry>
<entry>
<title>merge with 4.0.3-release</title>
<updated>2016-04-04T19:53:09Z</updated>
<author>
<name>Oz Linden</name>
<email>oz@lindenlab.com</email>
</author>
<published>2016-04-04T19:53:09Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=9be58e915a6c69de280ccabd3019e9ac40beed26'/>
<id>urn:sha1:9be58e915a6c69de280ccabd3019e9ac40beed26</id>
<content type='text'>
</content>
</entry>
<entry>
<title>MAINT-5976: Fix bug in LLCoros::set_consuming() mechanism.</title>
<updated>2015-12-18T23:06:32Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2015-12-18T23:06:32Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=2ee22ed26483381bb13bc840090bad1897b4fd27'/>
<id>urn:sha1:2ee22ed26483381bb13bc840090bad1897b4fd27</id>
<content type='text'>
The original implementation of set_consuming() involved a bool* pointing to a
local bool in VoidListener::operator()()'s stack frame. postAndSuspend() would
set that bool (through the pointer) as soon as it returned from suspension.

The trouble with that is that LLEventMailDrop potentially calls its new
listener (fulfilling the future) immediately in the listen_impl() override --
in other words, way up at the top of postAndSuspend(), well before the code
that sets the relevant bool.

Instead, make the adapter formerly known as VoidListener bind the coroutine's
get_consuming() value at adapter construction time (before listening on the
LLEventPump), so that its operator()() has the coroutine's correct
get_consuming() value to return. Eliminating the bool* makes the code both
simpler AND more correct!

This change makes that adapter very specific to coroutine usage. Rename it
FutureListener and migrate it from lleventcoros.h into the .cpp file. Nobody
else was using it anyway.

Make corresponding changes to postAndSuspend2() and its WaitForEventOnHelper
class -- whose name no longer corresponds to the function as it used to.
Rename that one FutureListener2. The new FutureListener functionality, common
to both these adapters, makes it useful to derive FutureListener2 from
FutureListener.

Introduce llmake(), a generic function to deduce template type arguments from
function parameter types. This allows us to remove the voidlistener() and
wfeoh() helper functions.

Hiding VoidListener broke one of the lleventcoro_test.cpp tests. But that test
was sort of a lame recap of an earlier implementation of postAndSuspend(),
based on LLEventPump events. Recast that test to illustrate how to use a
coroutine future to suspend a coroutine for something other than an LLEventPump.

But that rubbed my nose in the fact that we MUST wrap future's context
switching with proper management of the current coroutine. Introduce
LLCoros::Future&lt;T&gt;, which wraps boost::dcoroutines::future&lt;T&gt;.

Use LLCoros::Future&lt;T&gt; in postAndSuspend() and postAndSuspend2().
</content>
</entry>
<entry>
<title>MAINT-5976: Introduce LLCoros::set_consuming(bool).</title>
<updated>2015-12-16T22:13:04Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2015-12-16T22:13:04Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=6a062089b86c092d6227a64502c4829fc6f0c586'/>
<id>urn:sha1:6a062089b86c092d6227a64502c4829fc6f0c586</id>
<content type='text'>
set_consuming(true) tells each postAndSuspend() call to consume the event for
which it is suspending.
</content>
</entry>
</feed>
