gecko-dev/xpcom/rust
Nika Layzell 3e323b7d7a Bug 1739727 - Part 2: Improve rust async support in moz_task, r=emilio
This patch contains changes to moz_task to improve it's support for
async execution on multiple threads. Unlike the previous executor
implementation, this new implementation reduces the amount of unsafe
code substantially by depending on the async-task crate
(https://crates.io/crates/async-task) for the core task implementation.
This adds a few additional features:

 * Both local (no Send bound) and non-local (with Send bound) execution support,
 * Support for spawning on arbitrary nsIEventTargets or the background task pool,
 * Returned Task objects from runnables which may be .await-ed on or detach()-ed,
 * Support for spawning with the NS_DISPATCH_EVENT_MAY_BLOCK flag set,
 * Automatic use of NS_DISPATCH_AT_END when required,
 * Support for specifying the runnable priority for runnables.

There are also some correctness improvements, and exposed a better API
for dispatching normal runnable functions to background threads.

After these changes the TaskRunnable API should no longer be necessary.
It is re-implemented on top of the executor and kept in-place to avoid
rewriting all consumers.

Differential Revision: https://phabricator.services.mozilla.com/D130705
2021-12-07 20:01:41 +00:00
..
gecko_logger Backed out 5 changesets (bug 1736459) for causing Windows crashes (bug 1738034) a=backout 2021-10-27 16:02:24 +03:00
gkrust_utils Bug 1724152: Replace GkRustUtils::GenerateUUID with nsID::GenerateUUID. r=ckerschb 2021-11-04 08:55:46 +00:00
gtest Bug 1739727 - Part 2: Improve rust async support in moz_task, r=emilio 2021-12-07 20:01:41 +00:00
moz_task Bug 1739727 - Part 2: Improve rust async support in moz_task, r=emilio 2021-12-07 20:01:41 +00:00
nserror Bug 1664525 - Part 1: Update various xpcom crates to rust2018, r=emilio 2020-09-11 20:19:00 +00:00
nsstring Bug 1679095 - Extend nsstring to support creating void strings. r=nika 2020-12-12 00:43:30 +00:00
xpcom Bug 1741734 - Fix rust xpcom_macros future-compat warning, r=xpcom-reviewers,glandium 2021-11-18 00:48:53 +00:00