devices: virtio-snd: use Event to stop vios worker thread

The shm_vios backend for virtio-snd has a worker thread that needs to be
stopped when the device is shutting down. Before this change, it kept a
separate `running` value in a shared mutex-protected field, using an
Event to signal the thread to observe the new value of `running`.
However, it is sufficient to just exit the worker when the Event is
signaled, so we can remove the extra `running` field. The previous
behavior of handling all events returned from the latest WaitContext
wait() call is preserved (rather than breaking out of the loop directly)
to ensure behavior is not changed due to this patch.

BUG=b:269187468
TEST=tools/presubmit --all

Change-Id: I7c053d2d3e05c05d4e71dacf1b45836a2dc6d618
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4252080
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Pattara Teerapong <pteerapong@chromium.org>
Reviewed-by: Jorge Moreira Broche <jemoreira@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
1 file changed
tree: 6dac3ea12df0a2d0c3871329fca3597ac053d6ac
  1. .cargo/
  2. .config/
  3. .devcontainer/
  4. .github/
  5. .vscode/
  6. aarch64/
  7. acpi_tables/
  8. anti_tamper/
  9. arch/
  10. argh_helpers/
  11. base/
  12. bit_field/
  13. broker_ipc/
  14. common/
  15. crash_report/
  16. cros_async/
  17. cros_fdt/
  18. cros_tracing/
  19. crosvm-fuzz/
  20. crosvm_cli/
  21. crosvm_control/
  22. crosvm_plugin/
  23. devices/
  24. disk/
  25. docs/
  26. e2e_tests/
  27. fuse/
  28. gpu_display/
  29. hypervisor/
  30. infra/
  31. io_uring/
  32. jail/
  33. kernel_cmdline/
  34. kernel_loader/
  35. kvm/
  36. kvm_sys/
  37. libcras_stub/
  38. linux_input_sys/
  39. logo/
  40. media/
  41. metrics/
  42. net_sys/
  43. net_util/
  44. power_monitor/
  45. prebuilts/
  46. proto_build_tools/
  47. protos/
  48. qcow_utils/
  49. resources/
  50. rutabaga_gfx/
  51. sandbox/
  52. serde_keyvalue/
  53. src/
  54. swap/
  55. system_api/
  56. tests/
  57. third_party/
  58. tools/
  59. tpm2/
  60. tpm2-sys/
  61. tube_transporter/
  62. usb_sys/
  63. usb_util/
  64. vfio_sys/
  65. vhost/
  66. virtio_sys/
  67. vm_control/
  68. vm_memory/
  69. win_audio/
  70. win_util/
  71. x86_64/
  72. .dockerignore
  73. .gitignore
  74. .gitmodules
  75. .rustfmt.toml
  76. ARCHITECTURE.md
  77. Cargo.lock
  78. Cargo.toml
  79. CONTRIBUTING.md
  80. DIR_METADATA
  81. LICENSE
  82. mypy.ini
  83. OWNERS
  84. OWNERS_COUNCIL
  85. PRESUBMIT.cfg
  86. pyproject.toml
  87. README.chromeos.md
  88. README.md
  89. rust-toolchain
README.md

crosvm - The ChromeOS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on ChromeOS devices.

Logo