Go to file
Nat Goodspeed 2ee22ed264 MAINT-5976: Fix bug in LLCoros::set_consuming() mechanism.
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<T>, which wraps boost::dcoroutines::future<T>.

Use LLCoros::Future<T> in postAndSuspend() and postAndSuspend2().
2015-12-18 18:06:32 -05:00
debian merge 2013-03-11 15:17:13 -04:00
doc MAINT-5533 FIXED The fragment part of an URI is only shown if it contains a query part as well. 2015-08-20 12:04:57 +03:00
etc Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
indra MAINT-5976: Fix bug in LLCoros::set_consuming() mechanism. 2015-12-18 18:06:32 -05:00
scripts merge changes for 3.7.29-release 2015-06-08 16:33:02 -04:00
.hgignore merge changes for 3.7.29-release 2015-06-08 16:33:02 -04:00
.hgtags Added tag 3.8.6-release for changeset 5a5bd148943b 2015-10-26 17:06:20 -04:00
BuildParams Merge 2015-07-01 08:47:50 -07:00
autobuild.xml Merge from Vivox Repo 2015-11-23 13:04:01 -08:00
build.sh Ensure AUTOBUILD is in native_path form for non-cygwin tools. 2015-01-22 14:43:08 -05:00