Go to file
Nat Goodspeed e4d6383c47 DRTVWR-476: Fix overflow case in llcoro::postAndSuspend().
Actually the fix is in postAndSuspendSetup(), which affects postAndSuspend(),
postAndSuspendWithTimeout(), suspendUntilEventOnWithTimeout() and
suspendUntilEventOn().

By "overflow case" we mean the special circumstance in which:

* the LLEventPump in question is an LLEventMailDrop, meaning its listeners
  eventually expect to see every post()ed value
* one of the listeners is supposed to consume those values (has called
  LLCoros::set_consuming(true))
* post() is called more than once before that listener is resumed.

The magic of postAndSuspend() (et al.) is a temporary LLCoros::Promise. The
waiting coroutine calls get() on the corresponding Future, causing it to
suspend (as promised) until the Promise is fulfilled.

With the Boost.Fiber implementation of coroutines, fulfilling the Promise
doesn't immediately resume the suspended coroutine -- it merely marks it ready
to resume, next time the scheduler gets control.

A second post() call before the suspended coroutine is resumed results in a
second call to Promise::set_value(). But Promise is a one-shot entity. This
results in a promise_already_satisfied exception. Because a second post() call
during that time window is perfectly reasonable, we catch that exception and
carry on.

The tricky part is: when that exception is thrown, what should the listener
return? Previously we were returning the listener's current consuming setting,
just as when the set_value() call succeeds.

But when the LLEventPump is an LLEventMailDrop, and the listener's consuming
flag is true, that told LLEventMailDrop::post() that the value got through,
and that it needn't bother to save it in its history queue. The net effect was
to discard the value.

Instead, return the listener's consuming flag only when Promise::set_value()
succeeds. When it throws promise_already_satisfied, unconditionally return
false. That directs LLEventMailDrop::post() to enqueue the undelivered value
so that the *next* suspendUntilEventOn() call can pick it up.
2020-03-25 18:47:13 -04:00
debian
…
doc Merged in lindenlab/viewer-lynx 2019-06-22 03:17:43 +03:00
etc
…
indra DRTVWR-476: Fix overflow case in llcoro::postAndSuspend(). 2020-03-25 18:47:13 -04:00
scripts merge 2018-09-27 19:54:10 +01:00
.clang-format Convert ignore file to git, add a .clang-format rules file 2020-01-10 16:27:33 -07:00
.gitignore Ignore build-vc150-* directories as those are the VS2017 build dirs (n.b. due to the rather strange version numbering of VS this really should be build-vc141-*; as VS2017 is vc141 internally). 2020-03-25 18:44:04 -04:00
.hgtags Added tag 6.3.5-release for changeset 27ca5834bfe9 2019-12-12 13:15:52 -05:00
BuildParams remove duplicated EDU definitions 2018-09-05 09:12:21 -04:00
README.md
…
autobuild.xml DRTVWR-476: Update to viewer-manager build 531568 2020-03-25 18:47:13 -04:00
build.sh [DRTVWR-476] - disable dbghelp.h warnings 2020-03-25 18:39:20 -04:00

README.md

Second Life Viewer

This project manages the source code for the Second Life Viewer.

This source is available as open source; for details on licensing, see the licensing page on the Second Life wiki

For information on how to use and contribute to this, see the open source portal on the wiki.

To download the current default version, visit the download page. For even newer versions try the Alternate Viewers page