vhost_user_net: Use Mutex::get_mut() where possible

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2025-07-17 17:06:21 +00:00 committed by Wei Liu
parent 5716af09a5
commit 4be2ca4c10

View file

@ -205,7 +205,7 @@ impl VhostUserBackendMut for VhostUserNetBackend {
vrings: &[VringRwLock<GuestMemoryAtomic<GuestMemoryMmap>>],
thread_id: usize,
) -> VhostUserBackendResult<()> {
let mut thread = self.threads[thread_id].lock().unwrap();
let thread = self.threads[thread_id].get_mut().unwrap();
match device_event {
0 => {
if !thread.net.rx_tap_listening {