commit | 4ea33735019341aa288dc253e6ac2e2ad114d244 | [log] [tgz] |
---|---|---|
author | Daniel Verkamp <dverkamp@chromium.org> | Tue Feb 14 16:00:31 2023 -0800 |
committer | crosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Feb 15 23:58:22 2023 +0000 |
tree | 6dac3ea12df0a2d0c3871329fca3597ac053d6ac | |
parent | b3b7d63358e7102080450ffe51ebfa240aa5d47a [diff] |
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>
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.