<feed xmlns='http://www.w3.org/2005/Atom'>
<title>viewer.git/indra/llcommon/tests/lleventcoro_test.cpp, branch cef_147</title>
<subtitle>Megapahit's fork of the Second Life viewer.
</subtitle>
<id>https://megapahit.org/viewer.git/atom?h=cef_147</id>
<link rel='self' href='https://megapahit.org/viewer.git/atom?h=cef_147'/>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/'/>
<updated>2024-08-20T15:41:48Z</updated>
<entry>
<title>Clean up boost includes and remove compiler warning pragma for unreachable code in PCH (#2361)</title>
<updated>2024-08-20T15:41:48Z</updated>
<author>
<name>Ansariel Hiller</name>
<email>Ansariel@users.noreply.github.com</email>
</author>
<published>2024-08-20T15:41:48Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=9f7dd0177201fe080c287144b99a70125be1fb2b'/>
<id>urn:sha1:9f7dd0177201fe080c287144b99a70125be1fb2b</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>replace boost library to standard</title>
<updated>2024-01-08T21:29:21Z</updated>
<author>
<name>AiraYumi</name>
<email>aira.youme@airanyumi.net</email>
</author>
<published>2024-01-06T14:29:06Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=7c8907522fe6600918dacc15ee138ca72b2cf35e'/>
<id>urn:sha1:7c8907522fe6600918dacc15ee138ca72b2cf35e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-476: Infrastructure to help manage long-lived coroutines.</title>
<updated>2020-03-25T23:02:24Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-10-22T20:49:29Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=28a54c2f7b25b9fda763c51746701f0cd21c8018'/>
<id>urn:sha1:28a54c2f7b25b9fda763c51746701f0cd21c8018</id>
<content type='text'>
Introduce LLCoros::Stop exception, with subclasses Stopping, Stopped and
Shutdown. Add LLCoros::checkStop(), intended to be called periodically by any
coroutine with nontrivial lifespan. It checks the LLApp status and, unless
isRunning(), throws one of these new exceptions.

Make LLCoros::toplevel() catch Stop specially and log forcible coroutine
termination.

Now that LLApp status matters even in a test program, introduce a trivial
LLTestApp subclass whose sole function is to make isRunning() true.
(LLApp::setStatus() is protected: only a subclass can call it.) Add LLTestApp
instances to lleventcoro_test.cpp and lllogin_test.cpp.

Make LLCoros::toplevel() accept parameters by value rather than by const
reference so we can continue using them even after context switches.

Make private LLCoros::get_CoroData() static. Given that we've observed some
coroutines living past LLCoros destruction, making the caller call
LLCoros::instance() is more dangerous than encapsulating it within a static
method -- since the encapsulated call can check LLCoros::wasDeleted() first
and do something reasonable instead. This also eliminates the need for both a
const and non-const overload.

Defend LLCoros::delete_CoroData() (cleanup function for fiber_specific_ptr for
CoroData, implicitly called after coroutine termination) against calls after
~LLCoros().

Add a status string to coroutine-local data, with LLCoro::setStatus(),
getStatus() and RAII class TempStatus.

Add an optional 'when' string argument to LLCoros::printActiveCoroutines().
Make ~LLCoros() print the coroutines still active at destruction.
</content>
</entry>
<entry>
<title>DRTVWR-476: Add LLEventLogProxy, LLEventLogProxyFor&lt;T&gt;.</title>
<updated>2020-03-25T22:58:16Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-10-16T13:15:47Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=53aeea4d82801f5d624a4f6a62090195d3a24f2f'/>
<id>urn:sha1:53aeea4d82801f5d624a4f6a62090195d3a24f2f</id>
<content type='text'>
LLEventLogProxy can be introduced to serve as a logging proxy for an existing
LLEventPump subclass instance. Access through the LLEventLogProxy will be
logged; access directly to the underlying LLEventPump will not.

LLEventLogProxyFor&lt;LLEventPumpSubclass&gt; functions as a drop-in replacement for
the original LLEventPumpSubclass instance. It internally instantiates
LLEventPumpSubclass and serves as a proxy for that instance.

Add unit tests for LLEventMailDrop and LLEventLogProxyFor&lt;LLEventMailDrop&gt;,
both "plain" (events only) and via lleventcoro.h synchronization.
</content>
</entry>
<entry>
<title>DRTVWR-476: Add Sync class to help with stepwise coroutine tests.</title>
<updated>2020-03-25T22:44:04Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-09-11T13:33:07Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=d7c2e4a77bed665d7ab626d9955c35db8c318e95'/>
<id>urn:sha1:d7c2e4a77bed665d7ab626d9955c35db8c318e95</id>
<content type='text'>
Sync is specifically intended for test programs. It is based on an
LLScalarCond&lt;int&gt;. The idea is that each of two coroutines can watch for the
other to get a chance to run, indicated by incrementing the wrapped int and
notifying the wrapped condition_variable. This is less hand-wavy than calling
llcoro::suspend() and hoping that the other routine will have had a chance to
run.

Use Sync in lleventcoro_test.cpp.

Also refactor lleventcoro_test.cpp so that instead of a collection of static
data requiring a clear() call at start of each individual test function, the
relevant data is all part of the test_data struct common to all test
functions. Make the helper coroutine functions members of test_data too.

Introduce llcoro::logname(), a convenience function to log the name of the
currently executing coroutine or "main" if in the thread's main coroutine.
</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>DRTVWR-493: Make catch_llerrs() a member of WrapLLErrs.</title>
<updated>2019-08-12T12:26:51Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-08-12T12:26:51Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=f0fa4f94a5400fe5d21cf5bf7570129916bf9787'/>
<id>urn:sha1:f0fa4f94a5400fe5d21cf5bf7570129916bf9787</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.</title>
<updated>2019-08-11T00:33:59Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-08-11T00:33:59Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=adb3f447b33e42bdb6e4a5a1ac79eebd862dafb4'/>
<id>urn:sha1:adb3f447b33e42bdb6e4a5a1ac79eebd862dafb4</id>
<content type='text'>
Use them in place of awkward try/catch test boilerplate.
</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>
</feed>
