[vfs] Rework how ExecutionScope's shutdown works

This changes the way that ExecutionScope's shutdown feature works which
simplifies most uses.

With this new mechanism, after calling shutdown all tasks will continue
running whilst at least one is considered active. A guard is used to
mark a task as active. This will mean that some tasks run for longer
than they might have done prior to this change, but this should not have
any material difference.

Tasks that want async behaviour to take place when they are dropped
(rare) can spawn tasks from their drop functions and the executor will
delay shutdown until these async tasks have finished.

This results in a small decrease in binary size and it should take less
runtime memory too, but the main benefit is that spawning tasks is
simpler for the majority of uses.

Change-Id: Ia904ab970746f7efc871120f7e83b205ff303c40
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/858276
Fuchsia-Auto-Submit: Chris Suter <csuter@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Reviewed-by: Adam Barth <abarth@google.com>
Reviewed-by: Stephen Demos <sdemos@google.com>
Reviewed-by: Ben Keller <galbanum@google.com>
11 files changed
tree: aaf81feb56cc86b39a5231d5118ee7bb2f76113b
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. infra/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .editorconfig
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gitmodules
  21. .gn
  22. .ignore
  23. .style.yapf
  24. analysis_options.yaml
  25. AUTHORS
  26. BUILD.gn
  27. CODE_OF_CONDUCT.md
  28. CONTRIBUTING.md
  29. fuchsia.code-workspace
  30. LICENSE
  31. OWNERS
  32. PATENTS
  33. pyrightconfig.json
  34. README.md
  35. rustfmt.toml
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.