From ef7d27233e8338239e80664fb47fb5c691f07c29 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Tue, 2 Jul 2024 20:42:41 +0200 Subject: [PATCH] use a `read` guard instead of `write` --- wgpu-core/src/device/global.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 0d4cc4fe91..91fb0b421c 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -259,12 +259,9 @@ impl Global { ) -> Result<(), WaitIdleError> { let hub = A::hub(self); - let last_submission = { - let buffer_guard = hub.buffers.write(); - match buffer_guard.get(buffer_id) { - Ok(buffer) => buffer.submission_index(), - Err(_) => return Ok(()), - } + let last_submission = match hub.buffers.read().get(buffer_id) { + Ok(buffer) => buffer.submission_index(), + Err(_) => return Ok(()), }; hub.devices