[kernel][exceptions] fix thread kill/exception race

Previously, if a caller killed a thread then immediately resumed from
exception (e.g. via closing the exception port), there was a chance
that the resume status would take precedence and we would keep
processing the exception on a killed thread.

This CL adds an additional check so that if the thread is both resumed
and killed, the kill will always take precedence.

This is difficult to test in an automated unittest so these new tests
just run for 1 second and it'll show up as flake in the bots if the bug
returns. To test manually, insert a sleep in the kernel between sending
the exception and waiting for the response to lengthen the race window.

ZX-4105

Test: runtests
Test: while runtests -t exception-test; do :; done
Change-Id: I3894f0141e7dbcc84242aee1583a031028212f71
3 files changed
tree: f21f5dca1224c0f4f96d98dea912da53db6be802
  1. boards/
  2. build/
  3. buildtools/
  4. bundles/
  5. docs/
  6. examples/
  7. garnet/
  8. infra/
  9. peridot/
  10. products/
  11. scripts/
  12. sdk/
  13. src/
  14. third_party/
  15. tools/
  16. zircon/
  17. .clang-format
  18. .clang-tidy
  19. .dir-locals.el
  20. .gitattributes
  21. .gitignore
  22. .gn
  23. AUTHORS
  24. BUILD.gn
  25. CODE_OF_CONDUCT.md
  26. CONTRIBUTING.md
  27. LICENSE
  28. OWNERS
  29. PATENTS
  30. README.md
  31. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See the documentation.