зеркало из https://github.com/mozilla/gecko-dev.git
7b36ee37f3
For some clients, just dispatching tasks to some anonymous background thread is fine. But for other clients, they need to guarantee that dispatched events are executed in dispatch order, or they would like to have some guarantee that functions executing in the background are executing on a particular event target, or both. For such uses cases, we need something a little more sophisticated than simply handing out the `BackgroundEventTarget` `nsThreadManager` is using. Fortunately, we have an abstraction that provides these sorts of guarantees already in `mozilla::TaskQueue`. Since `mozilla::TaskQueue` requires a bit of special care during shutdown, we're not going to hand out new `TaskQueue` objects directly, but will instead hand out `nsISerialEventTarget` wrappers of the newly-created `TaskQueues`. `nsThreadManager` can then take care of shutting down all of the `TaskQueue` objects itself, rather than requiring clients to handle shutdown themselves. Differential Revision: https://phabricator.services.mozilla.com/D47454 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
base | ||
build | ||
components | ||
doc | ||
ds | ||
glue | ||
idl-parser | ||
io | ||
libxpt/xptcall | ||
reflect | ||
rust | ||
string | ||
system | ||
tests | ||
threads | ||
windbgdlg | ||
xpidl | ||
moz.build | ||
xpcom-config.h.in | ||
xpcom-private.h.in |